zuora_api 1.11.7 → 1.11.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: 96d51c04ec6e65ee390a9f143f069966d12e5d3204159946a1bf2c295105153d
4
- data.tar.gz: 9c13b7d6715eaaa6f9c1c2ca18129ebec8bf8df638928d8370b219af6864317c
3
+ metadata.gz: 32591a1ee931c290b8e4f8db9f5c9b6531f5e11bff393eb1f7789b78be231ae6
4
+ data.tar.gz: adc6e839f47d670cc3cd7b30f491fd418dd12b8d4342319ccfb6ace47ebf6558
5
5
  SHA512:
6
- metadata.gz: ee14b715f13a7e6c428b962cd0626d8f04f516a5a917e47e720088d0ccf7b9843bc8836f6fc4a4bba518af0871e52979e65c0447983b0cb5edf6af25241fa768
7
- data.tar.gz: 48a58a517294070a1c8ef0175c578d83a107bc765faddfdd85233b93e15909d3e6ad63ee39bf08ac4874fa843f301d9e20c739c2628882f56374f270ddb8a03e
6
+ metadata.gz: 0bc7ebeee44e9775250989c6a53af10a95b7d4c908e7a1c3c613d6f2c89f3a5e06c922dbf5623c8d1540b89579c229878dc3be7c65016294637d2fa5d39e9669
7
+ data.tar.gz: 55c77daad5f115fa7cdc1504e5dc89bca7f0643a8b4879927edec974cfc2d3a5879fd237245cd3f18c3cbd83ef05cdab9f6b47fbe889e45ae602d59faee1d3df
@@ -854,7 +854,7 @@ module ZuoraAPI
854
854
  end
855
855
 
856
856
  #Zuora REST Actions error (Create, Update, Delete, Amend)
857
- if body.class == Array
857
+ if body.class == Array && !body.compact.blank?
858
858
  all_errors = body.select {|obj| !obj['Success'] || !obj['success'] }.map {|obj| obj['Errors'] || obj['errors'] }.compact
859
859
  all_success = body.select {|obj| obj['Success'] || obj['success']}.compact
860
860
 
@@ -876,6 +876,11 @@ module ZuoraAPI
876
876
  end
877
877
 
878
878
  if body.class == Hash && body['message'].present?
879
+
880
+ if body['message'] && body['code'].present?
881
+ raise_errors_helper(error: body['code'], message: body['message'], raise_final: false)
882
+ end
883
+
879
884
  raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new(body['message'], response) if response.code == 500
880
885
  raise ZuoraAPI::Exceptions::ZuoraAPIError.new(body['message'], response) if ![200,201,202].include?(response.code)
881
886
  end
@@ -883,7 +888,12 @@ module ZuoraAPI
883
888
  self.errors_via_content_type(response: response, type: :json)
884
889
 
885
890
  #All other errors
886
- raise ZuoraAPI::Exceptions::ZuoraAPIError.new(response.body, response) if ![200,201,202].include?(response.code)
891
+ if ![200,201,202].include?(response.code)
892
+ if body == [nil]
893
+ raise ZuoraAPI::Exceptions::ZuoraAPIError.new('No error message. Invalid API request', response)
894
+ end
895
+ raise ZuoraAPI::Exceptions::ZuoraAPIError.new(response.body, response)
896
+ end
887
897
  end
888
898
  end
889
899
 
@@ -965,7 +975,7 @@ module ZuoraAPI
965
975
  return error, success, message
966
976
  end
967
977
 
968
- def raise_errors_helper(error: nil, message: nil, response: nil, errors: [], success: [])
978
+ def raise_errors_helper(error: nil, message: nil, response: nil, errors: [], success: [], raise_final: true)
969
979
  case error
970
980
  when /.*INVALID_SESSION/
971
981
  raise ZuoraAPI::Exceptions::ZuoraAPISessionError.new(message, response, errors, success)
@@ -1009,7 +1019,7 @@ module ZuoraAPI
1009
1019
  end
1010
1020
  raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new(message, response, errors, success)
1011
1021
  else
1012
- raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new("Z:#{error}::#{message}", response, errors, success)
1022
+ raise ZuoraAPI::Exceptions::ZuoraAPIInternalServerError.new("Z:#{error}::#{message}", response, errors, success) if raise_final
1013
1023
  end
1014
1024
  end
1015
1025
 
@@ -1,3 +1,3 @@
1
1
  module ZuoraAPI
2
- VERSION = "1.11.7"
2
+ VERSION = "1.11.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.7
4
+ version: 1.11.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zuora Strategic Solutions Group
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-07 00:00:00.000000000 Z
11
+ date: 2023-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler