{"action":"created","issue":{"url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/1173","labels_url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/1173/labels{/name}","comments_url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/1173/comments","events_url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/1173/events","html_url":"https://github.com/restlet/restlet-framework-java/issues/1173","id":119080786,"number":1173,"title":"JaxRS exceptions handling, missing thrown exception objects.","user":{"login":"theprivateland","id":6017805,"avatar_url":"https://avatars.githubusercontent.com/u/6017805?v=3","gravatar_id":"","url":"https://api.github.com/users/theprivateland","html_url":"https://github.com/theprivateland","followers_url":"https://api.github.com/users/theprivateland/followers","following_url":"https://api.github.com/users/theprivateland/following{/other_user}","gists_url":"https://api.github.com/users/theprivateland/gists{/gist_id}","starred_url":"https://api.github.com/users/theprivateland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theprivateland/subscriptions","organizations_url":"https://api.github.com/users/theprivateland/orgs","repos_url":"https://api.github.com/users/theprivateland/repos","events_url":"https://api.github.com/users/theprivateland/events{/privacy}","received_events_url":"https://api.github.com/users/theprivateland/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-11-26T17:06:31Z","updated_at":"2015-12-23T01:26:03Z","closed_at":null,"body":"I have a problem, I use jaxrs implementation of restlet and have added default status service to be able to catch uncaught exceptions and save stack trace information.\r\n\r\nIt is important issue as being unable to save errors is a severe issue.\r\n\r\nI have status service class:\r\n\r\n```java\r\n\r\npublic class DefaultStatusHandler extends StatusService {\r\n  \r\n  private static final Log log = new Log(DefaultStatusHandler.class);\r\n  \r\n  public DefaultStatusHandler() {\r\n    super();\r\n    this.setEnabled(true);\r\n    this.setOverwriting(false);\r\n  }\r\n  \r\n  @Override\r\n  public Status toStatus(Throwable t, Request request, Response response) {\r\n    Status status = super.toStatus(t, request, response);\r\n    return status;\r\n  }\r\n  \r\n  @Override\r\n  public Representation toRepresentation(\r\n          Status status,\r\n          Request request,\r\n          Response response) {\r\n    Throwable t = status.getThrowable();\r\n    \r\n    if(status.isError()) {\r\n      log.severe(\"Unexpected service exception.\", t, true);\r\n      \r\n      if (t != null) {\r\n        PrintWriter pw = new PrintWriter(new StringWriter());\r\n        t.printStackTrace(pw);\r\n        log.severe(\"Stack trace:\\n\" + pw.toString());\r\n      }\r\n    }\r\n\r\n    return super.toRepresentation(status, request, response);\r\n  }\r\n}\r\n\r\n```\r\n\r\nIts added:\r\n\r\n```java\r\n\r\npublic class JaxRsApp extends JaxRsApplication {\r\n  \r\n  static Log log = new Log(JaxRsApp.class);\r\n  \r\n  public JaxRsApp () {\r\n    super();\r\n    RestServiceApp app = new RestServiceApp();\r\n    this.add(app);\r\n    this.setStatusService(new DefaultStatusHandler());\r\n  }\r\n}\r\n\r\n```\r\n\r\nin one of jaxrs services I run:\r\n\r\n```java\r\nif (true) {\r\n        throw new SQLException(\"catch me!\");\r\n      }\r\n```\r\n\r\nAny of `toStatus` methods is not being entered and `toRepresenations` is being entered but the throwable is null!\r\n\r\nI need help here - is this correct? Where is the exception? Why `toStatus` is not entered?"},"comment":{"url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/comments/166773483","html_url":"https://github.com/restlet/restlet-framework-java/issues/1173#issuecomment-166773483","issue_url":"https://api.github.com/repos/restlet/restlet-framework-java/issues/1173","id":166773483,"user":{"login":"theprivateland","id":6017805,"avatar_url":"https://avatars.githubusercontent.com/u/6017805?v=3","gravatar_id":"","url":"https://api.github.com/users/theprivateland","html_url":"https://github.com/theprivateland","followers_url":"https://api.github.com/users/theprivateland/followers","following_url":"https://api.github.com/users/theprivateland/following{/other_user}","gists_url":"https://api.github.com/users/theprivateland/gists{/gist_id}","starred_url":"https://api.github.com/users/theprivateland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theprivateland/subscriptions","organizations_url":"https://api.github.com/users/theprivateland/orgs","repos_url":"https://api.github.com/users/theprivateland/repos","events_url":"https://api.github.com/users/theprivateland/events{/privacy}","received_events_url":"https://api.github.com/users/theprivateland/received_events","type":"User","site_admin":false},"created_at":"2015-12-23T01:26:03Z","updated_at":"2015-12-23T01:26:03Z","body":"I have used the mapper finally but the exception should be passed to status anyway. Ill close this issue as noone responds."}}