dbox 0.6.10 → 0.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +5 -0
- data/VERSION +1 -1
- data/dbox.gemspec +1 -1
- data/lib/dbox/syncer.rb +12 -7
- metadata +3 -3
data/History.txt
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
== 0.6.11 / 2012-04-10
|
2
|
+
* Minor Enhancements
|
3
|
+
* Added operations that failed change calculation to result hash on pull.
|
4
|
+
* Added stack traces to log output when rescuing exceptions.
|
5
|
+
|
1
6
|
== 0.6.10 / 2012-04-10
|
2
7
|
* Minor Enhancements
|
3
8
|
* Improved error handling on calculating changes on pull.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.11
|
data/dbox.gemspec
CHANGED
data/lib/dbox/syncer.rb
CHANGED
@@ -209,7 +209,7 @@ module Dbox
|
|
209
209
|
changelist[:conflicts] << res[1]
|
210
210
|
end
|
211
211
|
rescue Exception => e
|
212
|
-
log.error "Error while downloading #{c[:path]}: #{e.inspect}"
|
212
|
+
log.error "Error while downloading #{c[:path]}: #{e.inspect}\n#{e.backtrace.join("\n")}"
|
213
213
|
parent_ids_of_failed_entries << c[:parent_id]
|
214
214
|
changelist[:failed] << { :operation => :create, :path => c[:path], :error => e }
|
215
215
|
end
|
@@ -232,7 +232,7 @@ module Dbox
|
|
232
232
|
changelist[:conflicts] << res[1]
|
233
233
|
end
|
234
234
|
rescue Exception => e
|
235
|
-
log.error "Error while downloading #{c[:path]}: #{e.inspect}"
|
235
|
+
log.error "Error while downloading #{c[:path]}: #{e.inspect}\n#{e.backtrace.join("\n")}"
|
236
236
|
parent_ids_of_failed_entries << c[:parent_id]
|
237
237
|
changelist[:failed] << { :operation => :create, :path => c[:path], :error => e }
|
238
238
|
end
|
@@ -242,6 +242,9 @@ module Dbox
|
|
242
242
|
c[:is_dir] ? delete_dir(c) : delete_file(c)
|
243
243
|
database.delete_entry_by_path(c[:path])
|
244
244
|
changelist[:deleted] << c[:path]
|
245
|
+
when :failed
|
246
|
+
parent_ids_of_failed_entries << c[:parent_id]
|
247
|
+
changelist[:failed] << { :operation => c[:operation], :path => c[:path], :error => c[:error] }
|
245
248
|
else
|
246
249
|
raise(RuntimeError, "Unknown operation type: #{op}")
|
247
250
|
end
|
@@ -324,8 +327,8 @@ module Dbox
|
|
324
327
|
clone_api_into_current_thread()
|
325
328
|
Thread.current[:out] = calculate_changes(dir, operation)
|
326
329
|
rescue Exception => e
|
327
|
-
log.error "Error while caclulating changes #{dir
|
328
|
-
|
330
|
+
log.error "Error while caclulating changes for #{operation} on #{dir[:path]}: #{e.inspect}\n#{e.backtrace.join("\n")}"
|
331
|
+
Thread.current[:out] = [[:failed, dir.merge({ :operation => operation, :error => e })]]
|
329
332
|
end
|
330
333
|
end
|
331
334
|
end
|
@@ -473,7 +476,7 @@ module Dbox
|
|
473
476
|
changelist[:conflicts] << { :original => c[:path], :renamed => res[:path] }
|
474
477
|
end
|
475
478
|
rescue Exception => e
|
476
|
-
log.error "Error while uploading #{c[:path]}: #{e.inspect}"
|
479
|
+
log.error "Error while uploading #{c[:path]}: #{e.inspect}\n#{e.backtrace.join("\n")}"
|
477
480
|
changelist[:failed] << { :operation => :create, :path => c[:path], :error => e }
|
478
481
|
end
|
479
482
|
end
|
@@ -502,7 +505,7 @@ module Dbox
|
|
502
505
|
changelist[:conflicts] << { :original => c[:path], :renamed => res[:path] }
|
503
506
|
end
|
504
507
|
rescue Exception => e
|
505
|
-
log.error "Error while uploading #{c[:path]}: #{e.inspect}"
|
508
|
+
log.error "Error while uploading #{c[:path]}: #{e.inspect}\n#{e.backtrace.join("\n")}"
|
506
509
|
changelist[:failed] << { :operation => :update, :path => c[:path], :error => e }
|
507
510
|
end
|
508
511
|
end
|
@@ -523,10 +526,12 @@ module Dbox
|
|
523
526
|
database.delete_entry_by_path(c[:path])
|
524
527
|
changelist[:deleted] << c[:path]
|
525
528
|
rescue Exception => e
|
526
|
-
log.error "Error while deleting #{c[:path]}: #{e.inspect}"
|
529
|
+
log.error "Error while deleting #{c[:path]}: #{e.inspect}\n#{e.backtrace.join("\n")}"
|
527
530
|
changelist[:failed] << { :operation => :delete, :path => c[:path], :error => e }
|
528
531
|
end
|
529
532
|
end
|
533
|
+
when :failed
|
534
|
+
changelist[:failed] << { :operation => c[:operation], :path => c[:path], :error => c[:error] }
|
530
535
|
else
|
531
536
|
raise(RuntimeError, "Unknown operation type: #{op}")
|
532
537
|
end
|
metadata
CHANGED