cb-api 21.3.2 → 21.3.3
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 +4 -4
- data/CHANGELOG.md +1 -0
- data/lib/cb/utils/validator.rb +11 -2
- data/lib/cb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b3345f6917865639b2895b89958aca0b88cdd96
|
4
|
+
data.tar.gz: d9d26b5a3eef9e0c28606b67d95c467806bef032
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02eff17bccaa49fec2b0a58d16e30bdfd77fe978385c8f0831cb32682f5f5572174fcef790cff635b98cad7231bc06c11e34a05d8be81082fd50a8f054dfa193
|
7
|
+
data.tar.gz: f1e4fe5cb7329a214cbf206dae0791bdc44b2fbc1a60b5f9a0dd1b849e6a3b98f50070c32fa50d2d21d8b87fdbec9ec3844420b5087784c14f459f7c16ab4000
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,7 @@ Version History
|
|
2
2
|
====
|
3
3
|
* All Version bumps are required to update this file as well!!
|
4
4
|
----
|
5
|
+
* 21.3.3 Get whole error node, not just first. Check for 'Errors' instead of just 'errors'
|
5
6
|
* 21.3.2 Follow style guide more closely and use `.first` + return empty string when no errors node
|
6
7
|
* 21.3.1 Add error message to error raised from API
|
7
8
|
* 21.3.0 Add better error message to MissingRequiredField error in api_response
|
data/lib/cb/utils/validator.rb
CHANGED
@@ -32,8 +32,7 @@ module Cb
|
|
32
32
|
|
33
33
|
def fail_with_error_details(response, error_type)
|
34
34
|
processed_response = process_response_body(response)
|
35
|
-
|
36
|
-
error = error_type.new(error_message)
|
35
|
+
error = error_type.new(error_message(processed_response))
|
37
36
|
error.code = response.code rescue nil
|
38
37
|
error.raw_response = response
|
39
38
|
error.response = processed_response
|
@@ -64,6 +63,16 @@ module Cb
|
|
64
63
|
rescue MultiXml::ParseError
|
65
64
|
nil
|
66
65
|
end
|
66
|
+
|
67
|
+
def error_message(processed_response)
|
68
|
+
if processed_response['errors']
|
69
|
+
processed_response['errors']
|
70
|
+
elsif processed_response['Errors']
|
71
|
+
processed_response['Errors']
|
72
|
+
else
|
73
|
+
''
|
74
|
+
end
|
75
|
+
end
|
67
76
|
end
|
68
77
|
end
|
69
78
|
end
|
data/lib/cb/version.rb
CHANGED