{"action":"created","issue":{"url":"https://api.github.com/repos/elagin/motobatClient/issues/51","labels_url":"https://api.github.com/repos/elagin/motobatClient/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/elagin/motobatClient/issues/51/comments","events_url":"https://api.github.com/repos/elagin/motobatClient/issues/51/events","html_url":"https://github.com/elagin/motobatClient/issues/51","id":108552038,"number":51,"title":"Странный разбор ответа в HTTPClient.java","user":{"login":"elagin","id":611744,"avatar_url":"https://avatars.githubusercontent.com/u/611744?v=3","gravatar_id":"","url":"https://api.github.com/users/elagin","html_url":"https://github.com/elagin","followers_url":"https://api.github.com/users/elagin/followers","following_url":"https://api.github.com/users/elagin/following{/other_user}","gists_url":"https://api.github.com/users/elagin/gists{/gist_id}","starred_url":"https://api.github.com/users/elagin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elagin/subscriptions","organizations_url":"https://api.github.com/users/elagin/orgs","repos_url":"https://api.github.com/users/elagin/repos","events_url":"https://api.github.com/users/elagin/events{/privacy}","received_events_url":"https://api.github.com/users/elagin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elagin/motobatClient/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"rjhdby","id":7921742,"avatar_url":"https://avatars.githubusercontent.com/u/7921742?v=3","gravatar_id":"","url":"https://api.github.com/users/rjhdby","html_url":"https://github.com/rjhdby","followers_url":"https://api.github.com/users/rjhdby/followers","following_url":"https://api.github.com/users/rjhdby/following{/other_user}","gists_url":"https://api.github.com/users/rjhdby/gists{/gist_id}","starred_url":"https://api.github.com/users/rjhdby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjhdby/subscriptions","organizations_url":"https://api.github.com/users/rjhdby/orgs","repos_url":"https://api.github.com/users/rjhdby/repos","events_url":"https://api.github.com/users/rjhdby/events{/privacy}","received_events_url":"https://api.github.com/users/rjhdby/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-09-27T18:23:59Z","updated_at":"2015-10-04T07:00:09Z","closed_at":null,"body":"Попался на глаза такой кусок. Зачем два раза reader = new JSONObject делаем?\r\n```\r\n        try {\r\n            reader = new JSONObject(response.toString());\r\n        } catch (JSONException e) {\r\n            e.printStackTrace();\r\n            try {\r\n                reader = new JSONObject(response.toString().replace(\"\\\\\", \"\").replace(\"\\\"\", \"\"));\r\n            } catch (JSONException e1) {\r\n                e1.printStackTrace();\r\n                String fakeAnswer = \"{ isError : unknown }\";\r\n                try {\r\n                    reader = new JSONObject(fakeAnswer);\r\n                } catch (JSONException e2) {\r\n                    //Абсолютно маловероятно\r\n                    e2.printStackTrace();\r\n                    reader = new JSONObject();\r\n                }\r\n            }\r\n        }\r\n```"},"comment":{"url":"https://api.github.com/repos/elagin/motobatClient/issues/comments/145323560","html_url":"https://github.com/elagin/motobatClient/issues/51#issuecomment-145323560","issue_url":"https://api.github.com/repos/elagin/motobatClient/issues/51","id":145323560,"user":{"login":"rjhdby","id":7921742,"avatar_url":"https://avatars.githubusercontent.com/u/7921742?v=3","gravatar_id":"","url":"https://api.github.com/users/rjhdby","html_url":"https://github.com/rjhdby","followers_url":"https://api.github.com/users/rjhdby/followers","following_url":"https://api.github.com/users/rjhdby/following{/other_user}","gists_url":"https://api.github.com/users/rjhdby/gists{/gist_id}","starred_url":"https://api.github.com/users/rjhdby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjhdby/subscriptions","organizations_url":"https://api.github.com/users/rjhdby/orgs","repos_url":"https://api.github.com/users/rjhdby/repos","events_url":"https://api.github.com/users/rjhdby/events{/privacy}","received_events_url":"https://api.github.com/users/rjhdby/received_events","type":"User","site_admin":false},"created_at":"2015-10-04T07:00:08Z","updated_at":"2015-10-04T07:00:08Z","body":"Для чего сделано - не помню, но логика такая. Если ответ не разобрался - пробуем удалить из него все обратные слеши и разобрать снова, если и это не помогло - возвращаем ошибку, если ошибку вернули с ошибкой - возвращаем пустой json."}}