{"action":"closed","issue":{"url":"https://api.github.com/repos/stripe/stripe-java/issues/189","labels_url":"https://api.github.com/repos/stripe/stripe-java/issues/189/labels{/name}","comments_url":"https://api.github.com/repos/stripe/stripe-java/issues/189/comments","events_url":"https://api.github.com/repos/stripe/stripe-java/issues/189/events","html_url":"https://github.com/stripe/stripe-java/issues/189","id":93070858,"number":189,"title":"Request: Stripe InvalidRequestException should provide an error code","user":{"login":"alexg313","id":1124457,"avatar_url":"https://avatars.githubusercontent.com/u/1124457?v=3","gravatar_id":"","url":"https://api.github.com/users/alexg313","html_url":"https://github.com/alexg313","followers_url":"https://api.github.com/users/alexg313/followers","following_url":"https://api.github.com/users/alexg313/following{/other_user}","gists_url":"https://api.github.com/users/alexg313/gists{/gist_id}","starred_url":"https://api.github.com/users/alexg313/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexg313/subscriptions","organizations_url":"https://api.github.com/users/alexg313/orgs","repos_url":"https://api.github.com/users/alexg313/repos","events_url":"https://api.github.com/users/alexg313/events{/privacy}","received_events_url":"https://api.github.com/users/alexg313/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-05T03:13:57Z","updated_at":"2015-09-17T19:20:06Z","closed_at":"2015-09-17T19:20:06Z","body":"Currently when an InvalidRequestException (IRE) is thrown, no error code is provided. This forces the client to parse a string to determine what exactly the error is. Could the library add error codes where it makes sense? \r\n\r\nExample: When calling \"charge.capture()\" on an already captured charge, here's what is returned as part of the IRE. A code (i.e. CHARGE_ALREADY_CAPTURED) would be great. \r\n\r\ne.getParam(): null\r\ne.getLocalizedMessage(): Charge ch_16L0j8A1uVHZiLuVb8Say0YW has already been captured.\r\ne.getMessage(): Charge ch_16L0j8A1uVHZiLuVb8Say0YW has already been captured.\r\ne.getCause(): null"}}