{"action":"created","comment":{"url":"https://api.github.com/repos/helium/airship/pulls/comments/57642007","id":57642007,"diff_hunk":"@@ -140,6 +147,7 @@ instance MonadBaseControl b m => MonadBaseControl b (Webmachine m) where\n -- | A convenience synonym that writes the @Monad@ type constraint for you.\n type Handler m a = Monad m => Webmachine m a","path":"src/Airship/Types.hs","position":139,"original_position":139,"commit_id":"f9ade37a41c7525f6be30ea2cfc32c71c5929578","original_commit_id":"f9ade37a41c7525f6be30ea2cfc32c71c5929578","user":{"login":"tmcgilchrist","id":170937,"avatar_url":"https://avatars.githubusercontent.com/u/170937?v=3","gravatar_id":"","url":"https://api.github.com/users/tmcgilchrist","html_url":"https://github.com/tmcgilchrist","followers_url":"https://api.github.com/users/tmcgilchrist/followers","following_url":"https://api.github.com/users/tmcgilchrist/following{/other_user}","gists_url":"https://api.github.com/users/tmcgilchrist/gists{/gist_id}","starred_url":"https://api.github.com/users/tmcgilchrist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmcgilchrist/subscriptions","organizations_url":"https://api.github.com/users/tmcgilchrist/orgs","repos_url":"https://api.github.com/users/tmcgilchrist/repos","events_url":"https://api.github.com/users/tmcgilchrist/events{/privacy}","received_events_url":"https://api.github.com/users/tmcgilchrist/received_events","type":"User","site_admin":false},"body":"Might be remembering we removed it on our branch.\r\n\r\nI don't think it should be there, but we have had that conversation before :-) . I'm curious if you're using it anywhere?","created_at":"2016-03-28T22:06:53Z","updated_at":"2016-03-28T22:06:53Z","html_url":"https://github.com/helium/airship/pull/94#discussion_r57642007","pull_request_url":"https://api.github.com/repos/helium/airship/pulls/94","_links":{"self":{"href":"https://api.github.com/repos/helium/airship/pulls/comments/57642007"},"html":{"href":"https://github.com/helium/airship/pull/94#discussion_r57642007"},"pull_request":{"href":"https://api.github.com/repos/helium/airship/pulls/94"}}},"pull_request":{"url":"https://api.github.com/repos/helium/airship/pulls/94","id":60128045,"html_url":"https://github.com/helium/airship/pull/94","diff_url":"https://github.com/helium/airship/pull/94.diff","patch_url":"https://github.com/helium/airship/pull/94.patch","issue_url":"https://api.github.com/repos/helium/airship/issues/94","number":94,"state":"open","locked":false,"title":"Custom error response handling","user":{"login":"kellymclaughlin","id":29337,"avatar_url":"https://avatars.githubusercontent.com/u/29337?v=3","gravatar_id":"","url":"https://api.github.com/users/kellymclaughlin","html_url":"https://github.com/kellymclaughlin","followers_url":"https://api.github.com/users/kellymclaughlin/followers","following_url":"https://api.github.com/users/kellymclaughlin/following{/other_user}","gists_url":"https://api.github.com/users/kellymclaughlin/gists{/gist_id}","starred_url":"https://api.github.com/users/kellymclaughlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kellymclaughlin/subscriptions","organizations_url":"https://api.github.com/users/kellymclaughlin/orgs","repos_url":"https://api.github.com/users/kellymclaughlin/repos","events_url":"https://api.github.com/users/kellymclaughlin/events{/privacy}","received_events_url":"https://api.github.com/users/kellymclaughlin/received_events","type":"User","site_admin":false},"body":"This is a change that stems from the discussion on #93. That PR was an attempt to fix a bug with returning a custom response body for requests for unmatched routes, but this PR represents a more broad effort to improve handling of requests for unmatched routes and also provide a means to return a custom response body for any error code. \r\n\r\n*Note:* This work is currently incomplete. I have only added handling for the custom responses at `l07` in the decision tree. I'm opening the PR now to garner feedback on the approach before going any further. \r\n\r\nHere is a short summary of these changes mostly taken from the commit message:\r\n\r\n* Do not traverse the decision tree when no route matches. This mimics\r\n  the [behavior of Erlang Webmachine](https://github.com/webmachine/webmachine/blob/master/src/webmachine_mochiweb.erl#L62-L64) and simplifies dealing with such\r\n  requests. \r\n* Add the ability to specify a mapping of HTTP status codes to pairs of\r\n  content type header values and custom response bodies for an Airship\r\n  application or for an individual resource. The content type value in\r\n  the mapping is used to set the response `Content-Type` header and the\r\n  intention is that the specified content type value match the error\r\n  response body.In the case of conflicts between application-level and\r\n  resource-level error response mappings, the resource-level mappings\r\n  are favored. This also more closely mimics what is offered by Erlang Webmachine.\r\n* Replace the `Resource IO` parameter to `resourceToWai` with an\r\n  ErrorResponses type that represents the mapping from HTTP status code\r\n  to error response data. The 404 resource previously used to handle\r\n  unmatched routes is no longer necessary since requests for unmatched\r\n  routes now bail out early.","created_at":"2016-02-22T05:49:15Z","updated_at":"2016-03-28T22:06:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0531a8926ed5b871ddbcc988daf8d77f3c03814","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/helium/airship/pulls/94/commits","review_comments_url":"https://api.github.com/repos/helium/airship/pulls/94/comments","review_comment_url":"https://api.github.com/repos/helium/airship/pulls/comments{/number}","comments_url":"https://api.github.com/repos/helium/airship/issues/94/comments","statuses_url":"https://api.github.com/repos/helium/airship/statuses/f9ade37a41c7525f6be30ea2cfc32c71c5929578","head":{"label":"helium:custom-error-responses","ref":"custom-error-responses","sha":"f9ade37a41c7525f6be30ea2cfc32c71c5929578","user":{"login":"helium","id":6635330,"avatar_url":"https://avatars.githubusercontent.com/u/6635330?v=3","gravatar_id":"","url":"https://api.github.com/users/helium","html_url":"https://github.com/helium","followers_url":"https://api.github.com/users/helium/followers","following_url":"https://api.github.com/users/helium/following{/other_user}","gists_url":"https://api.github.com/users/helium/gists{/gist_id}","starred_url":"https://api.github.com/users/helium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helium/subscriptions","organizations_url":"https://api.github.com/users/helium/orgs","repos_url":"https://api.github.com/users/helium/repos","events_url":"https://api.github.com/users/helium/events{/privacy}","received_events_url":"https://api.github.com/users/helium/received_events","type":"Organization","site_admin":false},"repo":{"id":29756295,"name":"airship","full_name":"helium/airship","owner":{"login":"helium","id":6635330,"avatar_url":"https://avatars.githubusercontent.com/u/6635330?v=3","gravatar_id":"","url":"https://api.github.com/users/helium","html_url":"https://github.com/helium","followers_url":"https://api.github.com/users/helium/followers","following_url":"https://api.github.com/users/helium/following{/other_user}","gists_url":"https://api.github.com/users/helium/gists{/gist_id}","starred_url":"https://api.github.com/users/helium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helium/subscriptions","organizations_url":"https://api.github.com/users/helium/orgs","repos_url":"https://api.github.com/users/helium/repos","events_url":"https://api.github.com/users/helium/events{/privacy}","received_events_url":"https://api.github.com/users/helium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/helium/airship","description":"Helium + Webmachine = Airship. A toolkit for building declarative, RESTful web apps.","fork":false,"url":"https://api.github.com/repos/helium/airship","forks_url":"https://api.github.com/repos/helium/airship/forks","keys_url":"https://api.github.com/repos/helium/airship/keys{/key_id}","collaborators_url":"https://api.github.com/repos/helium/airship/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/helium/airship/teams","hooks_url":"https://api.github.com/repos/helium/airship/hooks","issue_events_url":"https://api.github.com/repos/helium/airship/issues/events{/number}","events_url":"https://api.github.com/repos/helium/airship/events","assignees_url":"https://api.github.com/repos/helium/airship/assignees{/user}","branches_url":"https://api.github.com/repos/helium/airship/branches{/branch}","tags_url":"https://api.github.com/repos/helium/airship/tags","blobs_url":"https://api.github.com/repos/helium/airship/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/helium/airship/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/helium/airship/git/refs{/sha}","trees_url":"https://api.github.com/repos/helium/airship/git/trees{/sha}","statuses_url":"https://api.github.com/repos/helium/airship/statuses/{sha}","languages_url":"https://api.github.com/repos/helium/airship/languages","stargazers_url":"https://api.github.com/repos/helium/airship/stargazers","contributors_url":"https://api.github.com/repos/helium/airship/contributors","subscribers_url":"https://api.github.com/repos/helium/airship/subscribers","subscription_url":"https://api.github.com/repos/helium/airship/subscription","commits_url":"https://api.github.com/repos/helium/airship/commits{/sha}","git_commits_url":"https://api.github.com/repos/helium/airship/git/commits{/sha}","comments_url":"https://api.github.com/repos/helium/airship/comments{/number}","issue_comment_url":"https://api.github.com/repos/helium/airship/issues/comments{/number}","contents_url":"https://api.github.com/repos/helium/airship/contents/{+path}","compare_url":"https://api.github.com/repos/helium/airship/compare/{base}...{head}","merges_url":"https://api.github.com/repos/helium/airship/merges","archive_url":"https://api.github.com/repos/helium/airship/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/helium/airship/downloads","issues_url":"https://api.github.com/repos/helium/airship/issues{/number}","pulls_url":"https://api.github.com/repos/helium/airship/pulls{/number}","milestones_url":"https://api.github.com/repos/helium/airship/milestones{/number}","notifications_url":"https://api.github.com/repos/helium/airship/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/helium/airship/labels{/name}","releases_url":"https://api.github.com/repos/helium/airship/releases{/id}","deployments_url":"https://api.github.com/repos/helium/airship/deployments","created_at":"2015-01-23T22:30:51Z","updated_at":"2016-03-23T12:41:34Z","pushed_at":"2016-03-28T15:01:00Z","git_url":"git://github.com/helium/airship.git","ssh_url":"git@github.com:helium/airship.git","clone_url":"https://github.com/helium/airship.git","svn_url":"https://github.com/helium/airship","homepage":"","size":305,"stargazers_count":174,"watchers_count":174,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":11,"forks":11,"open_issues":11,"watchers":174,"default_branch":"master"}},"base":{"label":"helium:master","ref":"master","sha":"4fd4a423e4ddf04d827964545c327f9feefdd9cf","user":{"login":"helium","id":6635330,"avatar_url":"https://avatars.githubusercontent.com/u/6635330?v=3","gravatar_id":"","url":"https://api.github.com/users/helium","html_url":"https://github.com/helium","followers_url":"https://api.github.com/users/helium/followers","following_url":"https://api.github.com/users/helium/following{/other_user}","gists_url":"https://api.github.com/users/helium/gists{/gist_id}","starred_url":"https://api.github.com/users/helium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helium/subscriptions","organizations_url":"https://api.github.com/users/helium/orgs","repos_url":"https://api.github.com/users/helium/repos","events_url":"https://api.github.com/users/helium/events{/privacy}","received_events_url":"https://api.github.com/users/helium/received_events","type":"Organization","site_admin":false},"repo":{"id":29756295,"name":"airship","full_name":"helium/airship","owner":{"login":"helium","id":6635330,"avatar_url":"https://avatars.githubusercontent.com/u/6635330?v=3","gravatar_id":"","url":"https://api.github.com/users/helium","html_url":"https://github.com/helium","followers_url":"https://api.github.com/users/helium/followers","following_url":"https://api.github.com/users/helium/following{/other_user}","gists_url":"https://api.github.com/users/helium/gists{/gist_id}","starred_url":"https://api.github.com/users/helium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helium/subscriptions","organizations_url":"https://api.github.com/users/helium/orgs","repos_url":"https://api.github.com/users/helium/repos","events_url":"https://api.github.com/users/helium/events{/privacy}","received_events_url":"https://api.github.com/users/helium/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/helium/airship","description":"Helium + Webmachine = Airship. A toolkit for building declarative, RESTful web apps.","fork":false,"url":"https://api.github.com/repos/helium/airship","forks_url":"https://api.github.com/repos/helium/airship/forks","keys_url":"https://api.github.com/repos/helium/airship/keys{/key_id}","collaborators_url":"https://api.github.com/repos/helium/airship/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/helium/airship/teams","hooks_url":"https://api.github.com/repos/helium/airship/hooks","issue_events_url":"https://api.github.com/repos/helium/airship/issues/events{/number}","events_url":"https://api.github.com/repos/helium/airship/events","assignees_url":"https://api.github.com/repos/helium/airship/assignees{/user}","branches_url":"https://api.github.com/repos/helium/airship/branches{/branch}","tags_url":"https://api.github.com/repos/helium/airship/tags","blobs_url":"https://api.github.com/repos/helium/airship/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/helium/airship/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/helium/airship/git/refs{/sha}","trees_url":"https://api.github.com/repos/helium/airship/git/trees{/sha}","statuses_url":"https://api.github.com/repos/helium/airship/statuses/{sha}","languages_url":"https://api.github.com/repos/helium/airship/languages","stargazers_url":"https://api.github.com/repos/helium/airship/stargazers","contributors_url":"https://api.github.com/repos/helium/airship/contributors","subscribers_url":"https://api.github.com/repos/helium/airship/subscribers","subscription_url":"https://api.github.com/repos/helium/airship/subscription","commits_url":"https://api.github.com/repos/helium/airship/commits{/sha}","git_commits_url":"https://api.github.com/repos/helium/airship/git/commits{/sha}","comments_url":"https://api.github.com/repos/helium/airship/comments{/number}","issue_comment_url":"https://api.github.com/repos/helium/airship/issues/comments{/number}","contents_url":"https://api.github.com/repos/helium/airship/contents/{+path}","compare_url":"https://api.github.com/repos/helium/airship/compare/{base}...{head}","merges_url":"https://api.github.com/repos/helium/airship/merges","archive_url":"https://api.github.com/repos/helium/airship/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/helium/airship/downloads","issues_url":"https://api.github.com/repos/helium/airship/issues{/number}","pulls_url":"https://api.github.com/repos/helium/airship/pulls{/number}","milestones_url":"https://api.github.com/repos/helium/airship/milestones{/number}","notifications_url":"https://api.github.com/repos/helium/airship/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/helium/airship/labels{/name}","releases_url":"https://api.github.com/repos/helium/airship/releases{/id}","deployments_url":"https://api.github.com/repos/helium/airship/deployments","created_at":"2015-01-23T22:30:51Z","updated_at":"2016-03-23T12:41:34Z","pushed_at":"2016-03-28T15:01:00Z","git_url":"git://github.com/helium/airship.git","ssh_url":"git@github.com:helium/airship.git","clone_url":"https://github.com/helium/airship.git","svn_url":"https://github.com/helium/airship","homepage":"","size":305,"stargazers_count":174,"watchers_count":174,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":11,"forks":11,"open_issues":11,"watchers":174,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/helium/airship/pulls/94"},"html":{"href":"https://github.com/helium/airship/pull/94"},"issue":{"href":"https://api.github.com/repos/helium/airship/issues/94"},"comments":{"href":"https://api.github.com/repos/helium/airship/issues/94/comments"},"review_comments":{"href":"https://api.github.com/repos/helium/airship/pulls/94/comments"},"review_comment":{"href":"https://api.github.com/repos/helium/airship/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/helium/airship/pulls/94/commits"},"statuses":{"href":"https://api.github.com/repos/helium/airship/statuses/f9ade37a41c7525f6be30ea2cfc32c71c5929578"}}}}