Skip to content

Commit

Permalink
Fix code style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
geeosh committed Nov 28, 2023
1 parent 1f479ac commit 83a650d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/uploadcare/client/uploader_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,18 @@ def poll_upload_response(token)
max_sleep_seconds: Uploadcare.config.max_request_sleep,
rescue: RetryError) do
response = get_upload_from_url_status(token)
handle_polling_response(response)
end
end

if response.success[:status] == 'error'
raise RequestError, response.success[:error]
elsif %w[progress waiting unknown].include?(response.success[:status])
raise RetryError, response.success[:error]
end

response
def handle_polling_response(response)
if response.success[:status] == 'error'
raise RequestError, response.success[:error]
elsif %w[progress waiting unknown].include?(response.success[:status])
raise RetryError, response.success[:error]
end

response
end

# Prepares body for upload_many method
Expand Down

0 comments on commit 83a650d

Please sign in to comment.