{"action":"closed","issue":{"url":"https://api.github.com/repos/falconry/falcon/issues/415","repository_url":"https://api.github.com/repos/falconry/falcon","labels_url":"https://api.github.com/repos/falconry/falcon/issues/415/labels{/name}","comments_url":"https://api.github.com/repos/falconry/falcon/issues/415/comments","events_url":"https://api.github.com/repos/falconry/falcon/issues/415/events","html_url":"https://github.com/falconry/falcon/issues/415","id":55274024,"number":415,"title":"It would be good if the errors had defaults for title and description fields, then they could be dispatched","user":{"login":"dukedougal","id":691840,"avatar_url":"https://avatars.githubusercontent.com/u/691840?v=3","gravatar_id":"","url":"https://api.github.com/users/dukedougal","html_url":"https://github.com/dukedougal","followers_url":"https://api.github.com/users/dukedougal/followers","following_url":"https://api.github.com/users/dukedougal/following{/other_user}","gists_url":"https://api.github.com/users/dukedougal/gists{/gist_id}","starred_url":"https://api.github.com/users/dukedougal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dukedougal/subscriptions","organizations_url":"https://api.github.com/users/dukedougal/orgs","repos_url":"https://api.github.com/users/dukedougal/repos","events_url":"https://api.github.com/users/dukedougal/events{/privacy}","received_events_url":"https://api.github.com/users/dukedougal/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/falconry/falcon/labels/enhancement","name":"enhancement","color":"bfe5bf"},{"url":"https://api.github.com/repos/falconry/falcon/labels/interface","name":"interface","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/falconry/falcon/milestones/21","html_url":"https://github.com/falconry/falcon/milestones/On%20Deck%20(Non-Breaking%20Changes)","labels_url":"https://api.github.com/repos/falconry/falcon/milestones/21/labels","id":1589027,"number":21,"title":"On Deck (Non-Breaking Changes)","description":"Work items that should be considered first for the next milestone, before looking in the backlog. ","creator":{"login":"kgriffs","id":719939,"avatar_url":"https://avatars.githubusercontent.com/u/719939?v=3","gravatar_id":"","url":"https://api.github.com/users/kgriffs","html_url":"https://github.com/kgriffs","followers_url":"https://api.github.com/users/kgriffs/followers","following_url":"https://api.github.com/users/kgriffs/following{/other_user}","gists_url":"https://api.github.com/users/kgriffs/gists{/gist_id}","starred_url":"https://api.github.com/users/kgriffs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgriffs/subscriptions","organizations_url":"https://api.github.com/users/kgriffs/orgs","repos_url":"https://api.github.com/users/kgriffs/repos","events_url":"https://api.github.com/users/kgriffs/events{/privacy}","received_events_url":"https://api.github.com/users/kgriffs/received_events","type":"User","site_admin":false},"open_issues":42,"closed_issues":1,"state":"open","created_at":"2016-02-17T17:39:09Z","updated_at":"2016-05-10T03:54:00Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-01-23T11:57:54Z","updated_at":"2016-05-10T03:54:00Z","closed_at":"2016-05-10T03:54:00Z","body":"I want to be able to pass error functions around for execution from a dispatcher. \r\n\r\nFor example, to have a dict like {'operationname': HTTPMethodNotAllowed}\r\n\r\nThen I could just invoke the method not allowed error by passing the function to something which executes it.\r\n\r\nCurrently I have to create a set of error functions like this with default values in them so I can dispatch error functions, just for the purpose of providing default values to title and description:\r\n\r\n    from falcon.http_error import HTTPError\r\n    import falcon.status_codes as status\r\n    \r\n    # a handful of simple HTTP errors that can be used without parameters\r\n    def code400BadRequest(*args, **kwargs):\r\n        # this is a request handler\r\n        raise HTTPError(status.HTTP_400, title=status.HTTP_400, description=status.HTTP_400)\r\n    \r\n    def code401Unauthorized(*args, **kwargs):\r\n        # this is a request handler\r\n        raise HTTPError(status.HTTP_401, title=status.HTTP_401, description=status.HTTP_401)\r\n    \r\n    def code403Forbidden(*args, **kwargs):\r\n        # this is a request handler\r\n        raise HTTPError(status.HTTP_403, title=status.HTTP_403, description=status.HTTP_403)\r\n    \r\n    def code404NotFound(*args, **kwargs):\r\n        # this is a request handler\r\n        raise HTTPError(status.HTTP_404, title=status.HTTP_404, description=status.HTTP_404)\r\n    \r\n    def code503ServiceUnavailable(*args, **kwargs):\r\n        # this is a request handler\r\n        raise HTTPError(status.HTTP_503, title=status.HTTP_503, description=status.HTTP_503)\r\n\r\nIf you guys included default values for title and description then  I could delete all the above code from my app and deleting code is always nice :-)"}}