lib/dbox/syncer.rb in dbox-0.8.0 vs lib/dbox/syncer.rb in dbox-0.8.1
- old
+ new
@@ -201,11 +201,11 @@
changelist[:created] << c[:path]
if res.kind_of?(Array) && res[0] == :conflict
changelist[:conflicts] ||= []
changelist[:conflicts] << res[1]
end
- rescue Exception => e
+ rescue => e
log.error "Error while downloading #{c[:path]}: #{e.inspect}\n#{e.backtrace.join("\n")}"
parent_ids_of_failed_entries << c[:parent_id]
changelist[:failed] << { :operation => :create, :path => c[:path], :error => e }
end
end
@@ -224,11 +224,11 @@
changelist[:updated] << c[:path]
if res.kind_of?(Array) && res[0] == :conflict
changelist[:conflicts] ||= []
changelist[:conflicts] << res[1]
end
- rescue Exception => e
+ rescue => e
log.error "Error while downloading #{c[:path]}: #{e.inspect}\n#{e.backtrace.join("\n")}"
parent_ids_of_failed_entries << c[:parent_id]
changelist[:failed] << { :operation => :create, :path => c[:path], :error => e }
end
end
@@ -314,11 +314,11 @@
# recursively process new & existing subdirectories in parallel
recur_dirs.each do |operation, dir|
begin
out += calculate_changes(dir, operation)
- rescue Exception => e
+ rescue => e
log.error "Error while caclulating changes for #{operation} on #{dir[:path]}: #{e.inspect}\n#{e.backtrace.join("\n")}"
out += [[:failed, dir.merge({ :operation => operation, :error => e })]]
end
end
@@ -455,11 +455,11 @@
else
log.warn "#{c[:path]} had a conflict and was renamed to #{res[:path]} on the server"
changelist[:conflicts] ||= []
changelist[:conflicts] << { :original => c[:path], :renamed => res[:path] }
end
- rescue Exception => e
+ rescue => e
log.error "Error while uploading #{c[:path]}: #{e.inspect}\n#{e.backtrace.join("\n")}"
changelist[:failed] << { :operation => :create, :path => c[:path], :error => e }
end
end
when :update
@@ -481,11 +481,11 @@
else
log.warn "#{c[:path]} had a conflict and was renamed to #{res[:path]} on the server"
changelist[:conflicts] ||= []
changelist[:conflicts] << { :original => c[:path], :renamed => res[:path] }
end
- rescue Exception => e
+ rescue => e
log.error "Error while uploading #{c[:path]}: #{e.inspect}\n#{e.backtrace.join("\n")}"
changelist[:failed] << { :operation => :update, :path => c[:path], :error => e }
end
end
when :delete
@@ -500,10 +500,10 @@
rescue Dbox::RemoteMissing
# safe to delete even if remote is already gone
end
database.delete_entry_by_path(c[:path])
changelist[:deleted] << c[:path]
- rescue Exception => e
+ rescue => e
log.error "Error while deleting #{c[:path]}: #{e.inspect}\n#{e.backtrace.join("\n")}"
changelist[:failed] << { :operation => :delete, :path => c[:path], :error => e }
end
when :failed
changelist[:failed] << { :operation => c[:operation], :path => c[:path], :error => c[:error] }