cb-api 22.2.1 → 22.3.0

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
  SHA1:
3
- metadata.gz: b91339a4af9df1083dbe017da2e095b87134f072
4
- data.tar.gz: 181fc3960de540685d452e67a723f7dce32dcc9a
3
+ metadata.gz: 52adea7edbe36610de7403e2d207681f07aed4bc
4
+ data.tar.gz: 83e8f7a21ebdfa78363a9222a8c426c484f33190
5
5
  SHA512:
6
- metadata.gz: 152d817c7fe7007b2fdaa37f101c0fd9a0aee2f15168a9996a021d4db139d0d57aec49ae328409557a91b488b40b1ee184f9a92f40276a140a11d6a162172c69
7
- data.tar.gz: c66d64889a844a4a69b012c0962b4f51b759368c631209a01d5a82c895684e6e7aaaeb54c489643164155ba7f6c44991d9526738318c27c6712e0b2f8e014766
6
+ metadata.gz: 3e883f3d3de6dd8106f42f50bfd92fb63ddd85e0edbd351ec11c5b20fb78bded648bec0dea2abd31c099d2fb3a6f12891d56e3e0829a95525ba4d746cbe6354b
7
+ data.tar.gz: 9e1623db22329bdcd51bc225817fd17b650afe8287ff4ca194bc56de30468f6506d15ed04d1641246627eb308dd0f95cad1eb4ea6af77fbe8f8dc07ae3149437
@@ -2,6 +2,7 @@ Version History
2
2
  ====
3
3
  * All Version bumps are required to update this file as well!!
4
4
  ----
5
+ * 22.3.0 Update validator to handle errors node being nested in the response.
5
6
  * 22.2.1 Add error checking and raising back on Job call
6
7
  * 22.2.0 Add new Recommendations client (alongside existing Recommendation client) that returns a hash
7
8
  * 22.1.0 Headers can be set on api instantiation.
@@ -36,7 +36,7 @@ module Cb
36
36
  error.code = response.code rescue nil
37
37
  error.raw_response = response
38
38
  error.response = processed_response
39
- fail error
39
+ raise error
40
40
  end
41
41
 
42
42
  def simulate_auth_outage?
@@ -65,7 +65,13 @@ module Cb
65
65
  end
66
66
 
67
67
  def error_message(processed_response)
68
- processed_response.fetch('errors', processed_response.fetch('Errors', ''))
68
+ return '' if processed_response.empty?
69
+ find_errors_node(processed_response) || ''
70
+ end
71
+
72
+ def find_errors_node(processed_response)
73
+ nested_hash = processed_response[processed_response.keys.first]
74
+ processed_response['errors'] || processed_response['Errors'] || nested_hash['errors'] || nested_hash['Errors']
69
75
  end
70
76
  end
71
77
  end
@@ -9,5 +9,5 @@
9
9
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
10
  # See the License for the specific language governing permissions and limitations under the License.
11
11
  module Cb
12
- VERSION = '22.2.1'
12
+ VERSION = '22.3.0'
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cb-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 22.2.1
4
+ version: 22.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The CareerBuilder.com Niche and Consumer Development teams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-21 00:00:00.000000000 Z
11
+ date: 2016-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty