{"action":"created","issue":{"url":"https://api.github.com/repos/haskell-servant/servant-server/issues/27","labels_url":"https://api.github.com/repos/haskell-servant/servant-server/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/haskell-servant/servant-server/issues/27/comments","events_url":"https://api.github.com/repos/haskell-servant/servant-server/issues/27/events","html_url":"https://github.com/haskell-servant/servant-server/issues/27","id":58292075,"number":27,"title":"Handlers can return an error response body","user":{"login":"thsutton","id":62708,"avatar_url":"https://avatars.githubusercontent.com/u/62708?v=3","gravatar_id":"","url":"https://api.github.com/users/thsutton","html_url":"https://github.com/thsutton","followers_url":"https://api.github.com/users/thsutton/followers","following_url":"https://api.github.com/users/thsutton/following{/other_user}","gists_url":"https://api.github.com/users/thsutton/gists{/gist_id}","starred_url":"https://api.github.com/users/thsutton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thsutton/subscriptions","organizations_url":"https://api.github.com/users/thsutton/orgs","repos_url":"https://api.github.com/users/thsutton/repos","events_url":"https://api.github.com/users/thsutton/events{/privacy}","received_events_url":"https://api.github.com/users/thsutton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-20T00:14:32Z","updated_at":"2015-02-20T00:24:44Z","closed_at":null,"body":"Currently the `(Int, String)` values represent an HTTP status only (i.e. the status code and reason phrase used in the HTTP response status line). It would be nice if servant handlers could supply a body to send to the client when they use `throwError`.\r\n\r\nAlternatively, we could allow handlers to specify an HTTP status code and reason when they succeed, as well as fail.\r\n\r\nThis would make it possible to implement APIs like, for example, OAuth2 which issues 400 Bad Request responses which include a JSON document describing the specific error."},"comment":{"url":"https://api.github.com/repos/haskell-servant/servant-server/issues/comments/75167758","html_url":"https://github.com/haskell-servant/servant-server/issues/27#issuecomment-75167758","issue_url":"https://api.github.com/repos/haskell-servant/servant-server/issues/27","id":75167758,"user":{"login":"thsutton","id":62708,"avatar_url":"https://avatars.githubusercontent.com/u/62708?v=3","gravatar_id":"","url":"https://api.github.com/users/thsutton","html_url":"https://github.com/thsutton","followers_url":"https://api.github.com/users/thsutton/followers","following_url":"https://api.github.com/users/thsutton/following{/other_user}","gists_url":"https://api.github.com/users/thsutton/gists{/gist_id}","starred_url":"https://api.github.com/users/thsutton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thsutton/subscriptions","organizations_url":"https://api.github.com/users/thsutton/orgs","repos_url":"https://api.github.com/users/thsutton/repos","events_url":"https://api.github.com/users/thsutton/events{/privacy}","received_events_url":"https://api.github.com/users/thsutton/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T00:24:44Z","updated_at":"2015-02-20T00:24:44Z","body":"Ideas\r\n=====\r\n\r\n## Extend MonadError instance\r\n\r\n\r\nExtend the `MonadError (Int, String)` to `MonadError (Int, String, Maybe v)` where `v` is some sort of encodable thingy (assuming #9 lands before this gets done).\r\n\r\nBut now I want to use a record instead of the 3-tuple.\r\n\r\n## Set custom status\r\n\r\nReplacing the `EitherT (Int, String) IO` with something like `EitherT (Int, String) (WriteT (Maybe (Int, String)) IO)` and adding a helper `setStatus :: (Int, String) -> EitherT (Int, String) (WriterT (Maybe (Int, String)) IO) ()`\r\n"}}