fastbound-ruby 1.1.8 → 1.1.11

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: 50830df9f9e5a74017244b8c88ee516a77a9eeae5be383682991979ebee49f80
4
- data.tar.gz: bb26944605d2a06c0363fa3f4d56b948bc962bd100577a8df26c836ce7ccb3ee
3
+ metadata.gz: 3b73655cd74799a5544706d1cee68d90f624013c6b1d6d14326ae99b68a1ae80
4
+ data.tar.gz: 5b45118be2b77d3583eb016322bd33f38f957f73ff510a17d1c2789d58023ff1
5
5
  SHA512:
6
- metadata.gz: a333e982aab96995f73f768953b7e0440afac23aeb597bc1ac72037ac0885d9299f05ff159e25bb755d87defe8fb08ee16a521e485b9256d3da32961ac92e99f
7
- data.tar.gz: 25196bf4c453658170c420924a241df4f60aed60534595febb004f87ad14cd67bcb13a40fa6460ad19131f83232d5e6ec54eaedc5a15f79f27eb25da44f8a9d4
6
+ metadata.gz: 1107e03904ae397f730cbe151aa4c1d861b1621f8000f2ca820e0ad67ace99ead061746e157efb9465eef319a80b42413cc75cb1ecaac9fb2c66bd59de087844
7
+ data.tar.gz: f120fdb59dcdf8b5b3a16e618c37211653789c7de84233784667a92eed9fa7bf5a14d22ac33fab24d24113948970008f2f9d5f0af65b16fa54af09c5ca6ad2ea
@@ -11,9 +11,7 @@ module FastBound
11
11
  raise FastBound::Error::NotAuthorized.new(@response.body)
12
12
  when Net::HTTPNotFound
13
13
  raise FastBound::Error::NotFound.new(@response.body)
14
- when Net::HTTPNoContent
15
- self.success = true
16
- when Net::HTTPOK, Net::HTTPSuccess
14
+ when Net::HTTPOK, Net::HTTPSuccess, Net::HTTPNoContent, Net::HTTPCreated
17
15
  self.success = true
18
16
  _data = (JSON.parse(@response.body) if @response.body.present?)
19
17
 
@@ -28,7 +26,13 @@ module FastBound
28
26
  puts "-- DEBUG: #{self}: RequestError: #{@response.inspect}"
29
27
  end
30
28
 
31
- raise FastBound::Error::RequestError.new([@response.body, @response.message].reject(&:blank?).join(" | "))
29
+ error_message = begin
30
+ JSON.parse(@response.body)['errors'].map { |error| error['message'].chomp('.') }.join('. ')
31
+ rescue
32
+ [@response.message, @response.body].reject(&:blank?).join(" | ")
33
+ end
34
+
35
+ raise FastBound::Error::RequestError.new(error_message)
32
36
  end
33
37
  end
34
38
 
@@ -1,3 +1,3 @@
1
1
  module FastBound
2
- VERSION = "1.1.8"
2
+ VERSION = "1.1.11"
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.8
4
+ version: 1.1.11
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-23 00:00:00.000000000 Z
11
+ date: 2022-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler