lib/filestack/utils/utils.rb in filestack-2.9.7 vs lib/filestack/utils/utils.rb in filestack-3.0.0
- old
+ new
@@ -7,17 +7,17 @@
require 'filestack/config'
class IntelligentState
attr_accessor :offset, :ok, :error_type
def initialize
- @offset = 524288
+ @offset = 524_288
@ok = true
@alive = true
@retries = 0
@backoff = 1
@offset_index = 0
- @offset_sizes = [524288, 262144, 131072, 65536, 32768]
+ @offset_sizes = [524_288, 262_144, 131_072, 65_536, 32_768]
end
def alive?
@alive
end
@@ -101,11 +101,11 @@
if response.code == 200
begin
response_body = JSON.parse(response.body)
return response_body
- rescue
+ rescue StandardError
raise response.body
end
end
raise response.body
end
@@ -315,11 +315,11 @@
part, state, part[:apikey], part[:filename], part[:filesize], part[:start_response], storage
)
Parallel.map(chunks, in_threads: 3) do |chunk|
begin
upload_chunk_intelligently(chunk, state, part[:apikey], filepath, io, part[:options], storage)
- rescue => e
+ rescue StandardError => e
state.error_type = e.message
failed = true
Parallel::Kill
end
end
@@ -399,11 +399,11 @@
else
raise 'BACKEND_SERVER'
end
end
- rescue
+ rescue StandardError
raise 'BACKEND_NETWORK'
end
fs_response = JSON.parse(fs_response.body)
# PUT to S3
@@ -417,10 +417,10 @@
else
raise 'S3_SERVER'
end
end
- rescue
+ rescue StandardError
raise 'S3_NETWORK'
end
amazon_response
end
end