{"action":"created","issue":{"url":"https://api.github.com/repos/toastdriven/restless/issues/47","labels_url":"https://api.github.com/repos/toastdriven/restless/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/toastdriven/restless/issues/47/comments","events_url":"https://api.github.com/repos/toastdriven/restless/issues/47/events","html_url":"https://github.com/toastdriven/restless/pull/47","id":74716814,"number":47,"title":"Default to False in TornadoResource.is_debug","user":{"login":"matt-snider","id":11810057,"avatar_url":"https://avatars.githubusercontent.com/u/11810057?v=3","gravatar_id":"","url":"https://api.github.com/users/matt-snider","html_url":"https://github.com/matt-snider","followers_url":"https://api.github.com/users/matt-snider/followers","following_url":"https://api.github.com/users/matt-snider/following{/other_user}","gists_url":"https://api.github.com/users/matt-snider/gists{/gist_id}","starred_url":"https://api.github.com/users/matt-snider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matt-snider/subscriptions","organizations_url":"https://api.github.com/users/matt-snider/orgs","repos_url":"https://api.github.com/users/matt-snider/repos","events_url":"https://api.github.com/users/matt-snider/events{/privacy}","received_events_url":"https://api.github.com/users/matt-snider/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-09T17:19:42Z","updated_at":"2015-09-03T21:50:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/toastdriven/restless/pulls/47","html_url":"https://github.com/toastdriven/restless/pull/47","diff_url":"https://github.com/toastdriven/restless/pull/47.diff","patch_url":"https://github.com/toastdriven/restless/pull/47.patch"},"body":"## Description\r\n`TornadoResource` error handling is broken if tornado.web.Application is not run in debug mode. \r\n\r\nDuring the handling of any error `Resource.build_error()` is called, which in turn calls `TornadoResource.is_debug()`. This will throw a `KeyError` if debug was not passed to the `Application` constructor. This is an optional parameter and should not be relied upon.\r\n\r\n## Example \r\nA simple example displaying this error can be seen below\r\n```python\r\nfrom tornado import web, ioloop\r\nfrom restless.exceptions import BadRequest\r\nfrom restless.tnd import TornadoResource\r\n\r\nclass TestTornadoResource(TornadoResource):\r\n    def list(self):\r\n        raise BadRequest()\r\n\r\n# Fails to handle the `BadRequest` properly\r\n# This will only work if debug=True/False is passed. \r\napp = web.Application([\r\n    (r'/', TestTornadoResource.as_list())\r\n])\r\n\r\nif __name__ == '__main__':\r\n    app.listen(8080)\r\n    ioloop.IOLoop.instance().start()\r\n```"},"comment":{"url":"https://api.github.com/repos/toastdriven/restless/issues/comments/137583687","html_url":"https://github.com/toastdriven/restless/pull/47#issuecomment-137583687","issue_url":"https://api.github.com/repos/toastdriven/restless/issues/47","id":137583687,"user":{"login":"matt-snider","id":11810057,"avatar_url":"https://avatars.githubusercontent.com/u/11810057?v=3","gravatar_id":"","url":"https://api.github.com/users/matt-snider","html_url":"https://github.com/matt-snider","followers_url":"https://api.github.com/users/matt-snider/followers","following_url":"https://api.github.com/users/matt-snider/following{/other_user}","gists_url":"https://api.github.com/users/matt-snider/gists{/gist_id}","starred_url":"https://api.github.com/users/matt-snider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matt-snider/subscriptions","organizations_url":"https://api.github.com/users/matt-snider/orgs","repos_url":"https://api.github.com/users/matt-snider/repos","events_url":"https://api.github.com/users/matt-snider/events{/privacy}","received_events_url":"https://api.github.com/users/matt-snider/received_events","type":"User","site_admin":false},"created_at":"2015-09-03T21:50:20Z","updated_at":"2015-09-03T21:50:20Z","body":"Hi! This is a really quick and simple fix, is there any reason it can't be merged? :smiley: "}}