fastbound-ruby 1.1.6 → 1.1.9

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
  SHA256:
3
- metadata.gz: d852c62270f374ee9e8114027108e39f67d74dbef1ca33c8f5ef2be371b04af3
4
- data.tar.gz: da98709eff4b8b3e4efefc218abaea16914fc0c7698ff5a044b8ce6fe4b38903
3
+ metadata.gz: af707e8890f47d21e549e2bc1bf223efc2d72968ba9a35ef6d06b6c6baad135e
4
+ data.tar.gz: 3b6a4b14695a9e6cb8041718407d826456aa6e2713b8f67dc44e4edea10f3ac1
5
5
  SHA512:
6
- metadata.gz: 18a3f83fc9a13b909fa3cb0014f3b44d3c1e085b33abf3cb3095a54d847e085ccc0ba1977f5ff064e497dc010c551b3fdd21f7a9b1d274e3ba6e4c185f348382
7
- data.tar.gz: 28f1071c6db244a90509b22bcd4c398797cea10018f806771abc9d59ad087bc22e03715aca63c8c4005e510b6d5e0cd35dc2bbb8f88355ba7beb11d5bfb8179d
6
+ metadata.gz: adc4956cc9d7cbcc271e50d068c3b98756e5a8bc2a1ab7f914c5cee465fb3f2fdc27475ef42c0ed17f17198b9893483b38df506c5a83885d844a1fa329935c4c
7
+ data.tar.gz: f335db2ba18fca0a6a7f2837f73053ab0040f57d4ce16895c2dc128253e469acb3dc978a432d9f1f98a7e1342a478878cbfd458f0ed26afa03f3b2097ce1d286
@@ -152,7 +152,7 @@ module FastBound
152
152
  post_request(@client, endpoint, commit_data)
153
153
  end
154
154
 
155
- def create_and_commit(disposition_data, items_data, contact_data = {}, commit_data = {})
155
+ def create_and_commit(disposition_data, items_data, contact_data = {}, commit_data = nil)
156
156
  items_data.each { |item| requires!(item, :id) }
157
157
 
158
158
  endpoint = ENDPOINTS[:create_and_commit]
@@ -12,7 +12,7 @@ module FastBound
12
12
  when Net::HTTPNotFound
13
13
  raise FastBound::Error::NotFound.new(@response.body)
14
14
  when Net::HTTPNoContent
15
- raise FastBound::Error::NoContent.new(@response.body)
15
+ self.success = true
16
16
  when Net::HTTPOK, Net::HTTPSuccess
17
17
  self.success = true
18
18
  _data = (JSON.parse(@response.body) if @response.body.present?)
@@ -28,7 +28,13 @@ module FastBound
28
28
  puts "-- DEBUG: #{self}: RequestError: #{@response.inspect}"
29
29
  end
30
30
 
31
- raise FastBound::Error::RequestError.new([@response.body, @response.message].reject(&:blank?).join(" | "))
31
+ error_message = begin
32
+ JSON.parse(@response.body)['errors'].map { |error| error['message'] }.join('. ')
33
+ rescue
34
+ [@response.message, @response.body].reject(&:blank?).join(" | ")
35
+ end
36
+
37
+ raise FastBound::Error::RequestError.new(error_message)
32
38
  end
33
39
  end
34
40
 
@@ -1,3 +1,3 @@
1
1
  module FastBound
2
- VERSION = "1.1.6"
2
+ VERSION = "1.1.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastbound-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey Dill
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-17 00:00:00.000000000 Z
11
+ date: 2022-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler