{"action":"created","issue":{"url":"https://api.github.com/repos/dropwizard/dropwizard/issues/974","labels_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/974/labels{/name}","comments_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/974/comments","events_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/974/events","html_url":"https://github.com/dropwizard/dropwizard/issues/974","id":66968479,"number":974,"title":"AsyncResponse.resume(Throwable) does not trigger ExceptionMapper","user":{"login":"arthurtsang","id":3580788,"avatar_url":"https://avatars.githubusercontent.com/u/3580788?v=3","gravatar_id":"","url":"https://api.github.com/users/arthurtsang","html_url":"https://github.com/arthurtsang","followers_url":"https://api.github.com/users/arthurtsang/followers","following_url":"https://api.github.com/users/arthurtsang/following{/other_user}","gists_url":"https://api.github.com/users/arthurtsang/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurtsang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurtsang/subscriptions","organizations_url":"https://api.github.com/users/arthurtsang/orgs","repos_url":"https://api.github.com/users/arthurtsang/repos","events_url":"https://api.github.com/users/arthurtsang/events{/privacy}","received_events_url":"https://api.github.com/users/arthurtsang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-07T19:05:46Z","updated_at":"2015-04-09T16:56:02Z","closed_at":null,"body":"i have the following API\r\n```\r\n@Timed\r\n@Path(\"{id}\")\r\n@DELETE\r\npublic void delete(@Suspended final AsyncResponse asyncResponse, @PathParam(\"id\") String id ){\r\n...\r\nasyncResponse.resume( new NoSuchElementException(\"can't find id\") );\r\n}\r\n```\r\nand exception mapper\r\n```\r\n@Provider\r\n@Singleton\r\npublic class NoSuchElementExceptionMapper implements ExceptionMapper<NoSuchElementException>{\r\n    @Override\r\n    public Response toResponse(NoSuchElementException exception) {\r\n        return ErrorResponse.status(404).throwable(exception).build();\r\n    }\r\n}\r\n```\r\nand registered it at a ConfiguredBundle's run method\r\n```\r\n@Override\r\n    public void run(SearchConfiguration searchConfiguration, Environment environment) throws Exception {\r\n...\r\n        environment.jersey().register(new NoSuchElementExceptionMapper());\r\n    }\r\n```\r\nthe exception mapper was never triggered.  however, if i throw the exception directly in the API method, it works."},"comment":{"url":"https://api.github.com/repos/dropwizard/dropwizard/issues/comments/91290018","html_url":"https://github.com/dropwizard/dropwizard/issues/974#issuecomment-91290018","issue_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/974","id":91290018,"user":{"login":"arteam","id":1717632,"avatar_url":"https://avatars.githubusercontent.com/u/1717632?v=3","gravatar_id":"","url":"https://api.github.com/users/arteam","html_url":"https://github.com/arteam","followers_url":"https://api.github.com/users/arteam/followers","following_url":"https://api.github.com/users/arteam/following{/other_user}","gists_url":"https://api.github.com/users/arteam/gists{/gist_id}","starred_url":"https://api.github.com/users/arteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arteam/subscriptions","organizations_url":"https://api.github.com/users/arteam/orgs","repos_url":"https://api.github.com/users/arteam/repos","events_url":"https://api.github.com/users/arteam/events{/privacy}","received_events_url":"https://api.github.com/users/arteam/received_events","type":"User","site_admin":false},"created_at":"2015-04-09T16:56:02Z","updated_at":"2015-04-09T16:56:02Z","body":"* Could you try to wrap your exception into [MappableException](https://github.com/jersey/jersey/blob/master/core-server/src/main/java/org/glassfish/jersey/server/internal/process/MappableException.java)?\r\n* If this doesn't work, you could try to register an exception mapper as [ResponseErrorMapper](https://github.com/jersey/jersey/blob/master/core-server/src/main/java/org/glassfish/jersey/server/spi/ResponseErrorMapper.java)\r\n\r\nResponse error mappers are not processed by default, so you need to enable this feature in the configuration:\r\n````java\r\nenvironment.jersey().property(ServerProperties.PROCESSING_RESPONSE_ERRORS_ENABLED, true);\r\n"}}