- hError :: (HttpM Response m, SendM m) => Status -> m ()
- hCustomError :: (HttpM Response m, SendM m) => Status -> String -> m ()
- hIOError :: (HttpM Response m, SendM m) => IOError -> m ()
- hSafeIO :: (MonadIO m, HttpM Response m, SendM m) => IO a -> (a -> m ()) -> m ()
- catchIO :: MonadIO m => IO a -> a -> m a
Documentation
hCustomError :: (HttpM Response m, SendM m) => Status -> String -> m ()Source
Like hError
but with a custom error message.
hIOError :: (HttpM Response m, SendM m) => IOError -> m ()Source
Map an IOError
to a default style error response.
The mapping from an IO error to an error response is rather straightforward:
| isDoesNotExistError e = hError NotFound | isAlreadyInUseError e = hError ServiceUnavailable | isPermissionError e = hError Forbidden | True = hError InternalServerError