-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No error details given when response is an HTTP 422 #50
Comments
Yeah, it is unfortunate that the error message isn't being passed but in the meantime, I believe you can retrieve the error message by parsing the response. begin
client.domain.create('my_app', {hostname: "mydomain.com"})
rescue Excon::Error::UnprocessableEntity => e
JSON.parse(e.response.data[:body])
end Hope that helps! |
Oh, didn't know response is wrapped into exception. That works around the issue, thanks! |
Yeah, if you leave it open I can see about improving the default messaging. Sorry for the difficulties here, but glad you have a reasonable workaround available. |
@geemus There are 2 places I could see making this improvement:
Thoughts? Other ideas? |
Yeah, I was thinking heroics would probably be the right level/place for it. |
It might be a good idea to add such an error response to the example in the README. I wanted to know what happens in case of an error (ie. if an error is raised, or if I have to look at the return value of eg. |
with curl:
The text was updated successfully, but these errors were encountered: