restforce-db 3.2.0 → 3.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab0eecfbe7d96562d9b473a036e8b84b95ea1394
4
- data.tar.gz: cb384f1779f4c48d8e654affc00e205ba5a86a8f
3
+ metadata.gz: f63cdbd13c368d67e00032954b0b920a03bdc818
4
+ data.tar.gz: 686cd54d4d4c9771e70668455c50eefabc68a4f2
5
5
  SHA512:
6
- metadata.gz: d7f800c5e374fdb8b3929cd9e23e2b17d31df13d9f74181985edd502248856a1cd39104dcf6131422d19fc4d0f598dd858d71983bda9f88ec52b5aff5cccf2dc
7
- data.tar.gz: 518570b3d2d27b7b0bf2b3a3aee7f1403eb98d6932e767aecb535f4e0a772ce8b2104674af6fa5f6105fda4ba6a90a45ef8618cdef7d1e2139bb0f9ac8b35e40
6
+ metadata.gz: 726c45542d070d66fd0a9d875c06391f20c25f1c75153ac459300fee7de7df81983e46e19f20e6124c85364b9a865a85bae7384f89190c1e1efd42cb1ab80c2a
7
+ data.tar.gz: 041b0467c120897e7bb5363ec3632a8f5f5b301d9a0585516a296d79771fdafe4ca9330cbcb8464833a9b033b2f4dc3af28f7ae3a7edf50cf6440189bc4300bf
@@ -39,6 +39,10 @@ module Restforce
39
39
  return unless database_instance && salesforce_instance
40
40
 
41
41
  sync_associations(database_instance, salesforce_instance)
42
+ rescue Faraday::Error::ClientError => e
43
+ # This should only be tripped if `synchronized_instances` makes a
44
+ # request to fetch the Salesforce instance.
45
+ DB.logger.error(SynchronizationError.new(e, database_instance))
42
46
  end
43
47
 
44
48
  # Internal: Given an instance for one system, find its synchronized pair
@@ -36,7 +36,7 @@ module Restforce
36
36
 
37
37
  @runner.cache_timestamp instance
38
38
  @runner.cache_timestamp created
39
- rescue ActiveRecord::ActiveRecordError => e
39
+ rescue ActiveRecord::ActiveRecordError, Faraday::Error::ClientError => e
40
40
  DB.logger.error(SynchronizationError.new(e, instance))
41
41
  end
42
42
 
@@ -3,7 +3,7 @@ module Restforce
3
3
  # :nodoc:
4
4
  module DB
5
5
 
6
- VERSION = "3.2.0"
6
+ VERSION = "3.2.1"
7
7
 
8
8
  end
9
9
 
@@ -2,8 +2,13 @@ require "file_daemon"
2
2
 
3
3
  module Restforce
4
4
 
5
+ # :nodoc:
5
6
  module DB
6
7
 
8
+ # TaskMapping is a small data structure used to pass top-level task
9
+ # information through to a SynchronizationError when necessary.
10
+ TaskMapping = Struct.new(:id, :mapping)
11
+
7
12
  # Restforce::DB::Worker represents the primary polling loop through which
8
13
  # all record synchronization occurs.
9
14
  class Worker
@@ -154,6 +159,9 @@ module Restforce
154
159
  # Returns nothing.
155
160
  def task(task_class, mapping)
156
161
  task_class.new(mapping, runner).run(@changes)
162
+ rescue Faraday::Error::ClientError => e
163
+ task_mapping = TaskMapping.new(task_class, mapping)
164
+ error SynchronizationError.new(e, task_mapping)
157
165
  end
158
166
 
159
167
  # Internal: Has this worker been instructed to stop?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restforce-db
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Horner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-14 00:00:00.000000000 Z
11
+ date: 2015-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord