Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions lib/dropbox_api/endpoints/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,19 @@ def process_response(raw_response)
raw_response.env[:api_result]['error']
)
when 429
error = DropboxApi::Errors::TooManyRequestsError.build(
raw_response.env[:api_result]['error_summary'],
raw_response.env[:api_result]['error']['reason']
)
# now while uploading a file dropbox returns 429 error code with none application/json content-type
# so raw_response.env[:api_result] is nil
error = if raw_response.env[:api_result]
DropboxApi::Errors::TooManyRequestsError.build(
raw_response.env[:api_result]['error_summary'],
raw_response.env[:api_result]['error']['reason']
)
else
DropboxApi::Errors::TooManyRequestsError.build(
'Too many requests.',
{ '.tag' => 'too_many_write_operations' }
)
end

error.retry_after = raw_response.headers['retry-after'].to_i

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.