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.
Files changed (5) hide show
  1. data/History.txt +5 -0
  2. data/VERSION +1 -1
  3. data/dbox.gemspec +1 -1
  4. data/lib/dbox/syncer.rb +12 -7
  5. metadata +3 -3
@@ -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.10
1
+ 0.6.11
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "dbox"
8
- s.version = "0.6.10"
8
+ s.version = "0.6.11"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ken Pratt"]
@@ -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.inspect}: #{operation}"
328
- log.error e.inspect
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
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dbox
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 10
10
- version: 0.6.10
9
+ - 11
10
+ version: 0.6.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ken Pratt