Skip to content
This repository was archived by the owner on Nov 23, 2024. It is now read-only.
This repository was archived by the owner on Nov 23, 2024. It is now read-only.

Requests: Get Oauth Error instead of real error #71

@joallard

Description

@joallard

I just tried moving a file to a path already present. Instead of getting the API error (A file with that name already exists at path...), I get a "Bad Oauth request".

From: /Users/jon/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/bundler/gems/dropbox-api-f62ac6348157/lib/dropbox-api/connection/requests.rb @ line 20 Dropbox::API::Connection::Requests#request:

    15:               raise Dropbox::API::Error::BadInput.new("400 - Bad input parameter - #{parsed['error']}")
    16:             when 401
    17:               raise Dropbox::API::Error::Unauthorized.new("401 - Bad or expired token")
    18:             when 403
    19:               parsed = MultiJson.decode(response.body)
 => 20:               raise Dropbox::API::Error::Forbidden.new('403 - Bad OAuth request')
    21:             when 404
    22:               raise Dropbox::API::Error::NotFound.new("404 - Not found")
    23:             when 405
    24:               parsed = MultiJson.decode(response.body)
    25:               raise Dropbox::API::Error::WrongMethod.new("405 - Request method not expected - #{parsed['error']}")

[9] pry(#<Dropbox::API::Connection>)> response.body
=> "{\"error\": \"A file with that name already exists at path ...\"}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions