Skip to content

Access response http status #8

@tak1n

Description

@tak1n

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions