X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Lucu.git;a=blobdiff_plain;f=Network%2FHTTP%2FLucu%2FAbortion%2FInternal.hs;h=69d7a9e9b247ce23a7b725afca47964e70ca616d;hp=573dff01d22eea4fe534def58c10b43300ae52db;hb=fffa09842d060c7d738084125dea07783d84aefe;hpb=060378af59e17e67e3cf79fc35f6e95ff770b9ef diff --git a/Network/HTTP/Lucu/Abortion/Internal.hs b/Network/HTTP/Lucu/Abortion/Internal.hs index 573dff0..69d7a9e 100644 --- a/Network/HTTP/Lucu/Abortion/Internal.hs +++ b/Network/HTTP/Lucu/Abortion/Internal.hs @@ -26,12 +26,12 @@ import Text.XML.HXT.Arrow.XmlArrow import Text.XML.HXT.Arrow.XmlState -- |'Abortion' is an 'Exception' that aborts the execution of --- 'Network.HTTP.Lucu.Resource.Resource' monad with a 'StatusCode', --- additional response headers, and an optional message text. +-- 'Network.HTTP.Lucu.Rsrc' monad with a 'StatusCode', additional +-- response headers, and an optional message text. -- --- 1. If the 'Network.HTTP.Lucu.Resource.Resource' is in the /Deciding --- Header/ or any precedent states, throwing an 'Abortion' affects --- the HTTP response to be sent to the client. +-- 1. If the 'Network.HTTP.Lucu.Rsrc' is in the /Deciding Header/ or +-- any precedent states, throwing an 'Abortion' affects the HTTP +-- response to be sent to the client. -- -- 2. Otherwise it's too late to overwrite the HTTP response so the -- only possible thing the system can do is to dump the exception @@ -41,9 +41,11 @@ import Text.XML.HXT.Arrow.XmlState -- 'isError' so you can abuse this exception for redirections as well -- as error reporting e.g. -- --- > abort $ mkAbortion MovedPermanently --- > [("Location", "http://example.net/")] --- > "It has been moved to example.net" +-- @ +-- 'Network.HTTP.Lucu.abort' '$' 'Network.HTTP.Lucu.mkAbortion' 'MovedPermanently' +-- [(\"Location\", \"http://example.net/\")] +-- ('Just' \"It's been moved to example.net.\") +-- @ data Abortion = Abortion { aboStatus ∷ !SomeStatusCode , aboHeaders ∷ !Headers