{"action":"opened","issue":{"url":"https://api.github.com/repos/OpenUnirest/unirest-java/issues/49","repository_url":"https://api.github.com/repos/OpenUnirest/unirest-java","labels_url":"https://api.github.com/repos/OpenUnirest/unirest-java/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/OpenUnirest/unirest-java/issues/49/comments","events_url":"https://api.github.com/repos/OpenUnirest/unirest-java/issues/49/events","html_url":"https://github.com/OpenUnirest/unirest-java/issues/49","id":390224471,"node_id":"MDU6SXNzdWUzOTAyMjQ0NzE=","number":49,"title":"How to get Response Body on server error","user":{"login":"philippendrulat","id":15322673,"node_id":"MDQ6VXNlcjE1MzIyNjcz","avatar_url":"https://avatars3.githubusercontent.com/u/15322673?v=4","gravatar_id":"","url":"https://api.github.com/users/philippendrulat","html_url":"https://github.com/philippendrulat","followers_url":"https://api.github.com/users/philippendrulat/followers","following_url":"https://api.github.com/users/philippendrulat/following{/other_user}","gists_url":"https://api.github.com/users/philippendrulat/gists{/gist_id}","starred_url":"https://api.github.com/users/philippendrulat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philippendrulat/subscriptions","organizations_url":"https://api.github.com/users/philippendrulat/orgs","repos_url":"https://api.github.com/users/philippendrulat/repos","events_url":"https://api.github.com/users/philippendrulat/events{/privacy}","received_events_url":"https://api.github.com/users/philippendrulat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-12T13:25:00Z","updated_at":"2018-12-12T13:25:00Z","closed_at":null,"author_association":"NONE","body":"My Problem:\r\n* I want to get an object from a server. The type is MyType.class.\r\n* The server throws an exception. It sends a message of the exception in the Http Body.\r\n* The body is not of type MyType.class \r\n\r\nNow, I want to know the body. Previously, this was possible by using HttpResponse.getRawBody(). Unfortunately, now the response body is null and the raw body is an empty InputStream. Since the object mapper tries to map it to MyType.class, an exception gets thrown and the exception gets saved as HttpResponse.parsingError. \r\n\r\nHow do I access the message of the server? I could see the message if I override the ObjectMapper, catch the exception and extend the exception by the original body, but I don't think this is the intended way."}}
{"actor":{"display_login":"philippendrulat"}}