salesforcebulk 4.0.1 → 4.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f032203ffa9c8c7b62236b41582b120f71ea8db3d61c47225d9e50c8c0cd5df6
4
- data.tar.gz: f2af5753284c05df4280f2b170b03cce923c2a229e9c86eb6c2573843d2a3fd7
3
+ metadata.gz: 42ac9c846c52bca60cea6a59ef20772e9f73752f4a6033767b7686ab5db36c79
4
+ data.tar.gz: 730c25ca9264445f4493740f294c09427e56f58236f2b12ea044c8fdc855b26f
5
5
  SHA512:
6
- metadata.gz: e7a8a9ea7f98d8dba1f482482b6dd693f76978a01069b206d6bda1c1e6a681e59384b4ed8a493586520fb45941689b2479051f0af55df0e3104b2796f3427a0f
7
- data.tar.gz: f1f7a957d188f22704c8ae6d756435faa70344b4c65ae76ea27223202f6e2159078b58c866c073ec3b48dce14323616710a4b5833ac25007f329f3e7f720fd96
6
+ metadata.gz: 7aa5f86d57dfeb8eb463e0f7a444d5f757622ba5e26a73013c3e58b3de20c0464de541c3edef878b72a8d081ec9acac7cf99f0353f03d58942b4b583e17fc485
7
+ data.tar.gz: ae2bc3c0bd319fd7f3dbde38f34233e4aadfb06af0dfba06bd53be88be477401259d22b3690c956da23c6c74940c72238f85fbf5f25398e067ee4bfef735716f
@@ -5,25 +5,28 @@ module SalesforceBulk
5
5
  attr_accessor :response
6
6
  # The status code from the server response body.
7
7
  attr_accessor :error_code
8
-
8
+
9
9
  def initialize(response)
10
10
  self.response = response
11
-
12
- data = XmlSimple.xml_in(response.body, 'ForceArray' => false)
13
-
14
- if data
15
- # seems responses for CSV requests use a different XML return format
16
- # (use invalid_error.xml for reference)
17
- if !data['exceptionMessage'].nil?
18
- message = data['exceptionMessage']
19
- else
20
- # SOAP error response
21
- message = data['Body']['Fault']['faultstring']
11
+ self.error_code = response.code
12
+
13
+ if (300..308).cover?(error_code.to_i)
14
+ message = "Moved to #{response.header['location']}"
15
+ else
16
+ data = XmlSimple.xml_in(response.body, 'ForceArray' => false)
17
+
18
+ if data
19
+ # seems responses for CSV requests use a different XML return format
20
+ # (use invalid_error.xml for reference)
21
+ if !data['exceptionMessage'].nil?
22
+ message = data['exceptionMessage']
23
+ else
24
+ # SOAP error response
25
+ message = data['Body']['Fault']['faultstring']
26
+ end
22
27
  end
23
-
24
- self.error_code = response.code
25
28
  end
26
-
29
+
27
30
  super(message)
28
31
  end
29
32
  end
@@ -1,3 +1,3 @@
1
1
  module SalesforceBulk
2
- VERSION = "4.0.1"
2
+ VERSION = "4.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salesforcebulk
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Julio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-13 00:00:00.000000000 Z
11
+ date: 2022-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xml-simple
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  requirements: []
133
- rubygems_version: 3.1.4
133
+ rubygems_version: 3.3.6
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: Full capability support for the Salesforce Bulk API.