Skip to content
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

Access response http status #8

Open
tak1n opened this issue Oct 27, 2016 · 0 comments
Open

Access response http status #8

tak1n opened this issue Oct 27, 2016 · 0 comments

Comments

@tak1n
Copy link

tak1n commented Oct 27, 2016

For proper error handling we want to rely on the http status codes which pinterest api gives back: https://developers.pinterest.com/docs/api/overview/#errors

Currently in https://github.com/realadeel/pinterest-api/blob/master/lib/pinterest/client.rb#L60 only the response body will be returned.

An example response:

[2] pry(#<Onlim::Adapter::Publish::Link::Pinterest>)> response
=> {"status"=>"failure", "code"=>3, "host"=>"devplatform-devapi-prod-f7410648", "generated_at"=>"Wed, 26 Oct 2016 09:19:28 +0000", "message"=>"Authorization failed.", "data"=>nil}

We want to rely on the documented http return status codes instead of relying on the code which is returned in the body (didn't find documentation about this code).

Are there any problems in returning the whole response?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant