[web-devel] Last call for comments: WAI 0.4

Michael Snoyman michael at snoyman.com
Wed Mar 30 18:18:17 CEST 2011

On Wed, Mar 30, 2011 at 6:15 PM, Bas van Dijk <v.dijk.bas at gmail.com> wrote:
> On 30 March 2011 18:01, Michael Snoyman <michael at snoyman.com> wrote:
>> On Wed, Mar 30, 2011 at 5:58 PM, Bas van Dijk <v.dijk.bas at gmail.com> wrote:
>>> On 28 March 2011 09:02, Michael Snoyman <michael at snoyman.com> wrote:
>>>> Just wanted to give everyone a last chance to give input on WAI 0.4
>>>> before its release.
>>> Hi Michael,
>>> What's the role of the errorHandler :: String -> IO () in the Request type:
>>> https://github.com/snoyberg/wai/blob/master/Network/Wai.hs#L73 ?
>>> It seems a bit odd to have this in a request.
>>> Thanks,
>>> Bas
>> The idea is to allow the server to give the application a general way
>> of logging error messages. Frankly, I don't personally use it at all,
>> and it was a relic from when I was trying to merge the original WAI
>> (proposed by Johan) and Hack. Do people have ideas on how to make it
>> more useful, or perhaps a better name for it? This is probably a good
>> area for improvement.
> Thanks for the explanation. I think it makes more sense to either
> remove the error handler or move it to the Application as in:
> type Application = ErrorHandler -> Request -> Iteratee B.ByteString IO Response
> type ErrorHandler = String -> IO ()
> Bas

Moving it to Application like that will simply make it more difficult
to write Middlewares. I think I understand the theoretical advantage,
but I don't think there's a practical advantage here.


More information about the web-devel mailing list