cb-api 17.2.0 → 17.3.0

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
  SHA1:
3
- metadata.gz: cc361451cedcf53facb26907387a0ac7ec5f8414
4
- data.tar.gz: 02ee8f06d35f76f97f31d6ac1610f8fdd1a123c1
3
+ metadata.gz: aa8e3cd1a0b1dcc5ae4ee02097d1b7b9bb124956
4
+ data.tar.gz: 756ebb65276e94919991643e6a8ff731cb9a4443
5
5
  SHA512:
6
- metadata.gz: f38f46f69986d146be3782e52406aac88d4871b07d6d1ce5b5e15d92c30686a2ab974acbec2e17118709ddf18763186fd90b0b430d4bcb7615e702971fce916d
7
- data.tar.gz: 2c72fa5e9facb62007da9124dc57ff3069a9b1ea5ac6d55bd52072a6d7ffc84a6d2e15d1d15ce533394c469a2ee919d94bb5d808b5569f2f9110eb10d7007f48
6
+ metadata.gz: ff9ba223b51017dc29f98a7004dc813be2ab55ccdec9ef97ff9d3fce28eafc14cc1199ba297520b527ccdba435e809f08aa6498306b9b02f5c57fe82bacc8a43
7
+ data.tar.gz: 3da61a8455907388a9f341c81c5552859c0eeafbc8c20b5c7661c5643983413c73e6b67e910b9153dfbc2d1955f30fa985172d6651cadfb2d77963d66112be78
@@ -3,6 +3,7 @@ Version History
3
3
  * All Version bumps are required to update this file as well!!
4
4
  ----
5
5
 
6
+ * 17.3.0 Set `ENV['SIMULATE_AUTH_OUTAGE']` to true to throw a `Cb::ServiceUnavailableError` for all API calls.
6
7
  * 17.2.0 Give back more information about the API caller for timings
7
8
  * 17.1.0 Start sending timings to all observers for API calls
8
9
  * 17.0.2 making sure we explicitly ask for version 1 of the consumer APIs
@@ -14,10 +14,14 @@ module Cb
14
14
 
15
15
  def raise_response_code_errors(response)
16
16
  code = response.code rescue nil
17
- raise Cb::ServiceUnavailableError if code == 503
17
+ raise Cb::ServiceUnavailableError if (code == 503 || simulate_auth_outage?)
18
18
  raise Cb::UnauthorizedError if code == 401
19
19
  end
20
20
 
21
+ def simulate_auth_outage?
22
+ ENV['SIMULATE_AUTH_OUTAGE'].to_s.downcase == 'true'
23
+ end
24
+
21
25
  def process_response_body(response)
22
26
  body = response.response.body rescue nil
23
27
  return Hash.new if !body
@@ -1,3 +1,3 @@
1
1
  module Cb
2
- VERSION = '17.2.0'
2
+ VERSION = '17.3.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cb-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 17.2.0
4
+ version: 17.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - The CareerBuilder.com Niche and Consumer Development teams