cortex-exceptions 0.0.2 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 458ccbe87f994cfa98e1f270ac749ac2c68e5eba
4
- data.tar.gz: f9c8671727fc4253bd4bb78fa4592ac9f1531295
3
+ metadata.gz: 25e9e5e1527cb16da3d331d52b3a1a652380b6ec
4
+ data.tar.gz: 651b2f1f517cda27504bccca0eb5a71f471557d8
5
5
  SHA512:
6
- metadata.gz: e6ef935ee6a317b3cf76403cb422320f9adec668607b3af78b436fa050a58183ed59817adec0634ec60313a0f53f13bd43750f397b09fb931e0904a076d812e0
7
- data.tar.gz: a5564c8105c098747f33df4225621d13fcb6548df79f75df43e7e4e24f3e662260b1da33b614106a4f83176f6d2f62a77667cbe34ce5e59913346119db7d52d0
6
+ metadata.gz: 0191b17111ccb561406eaca6438710e331c604d41681855e5a1ac0ae957794dcc751fd5b9d965d5a10b6c1cce31c7fac6b9cf417ec45d471ed095a8c2ddfb76e
7
+ data.tar.gz: 5cfd5aec66ba30771d9a2345176b7a535fb988b518cff3a8094c9fe29948e3d5579bd3503482e298c9657a2346b175b865cd8e2fce3280c4b37e1e40a053fcd4
@@ -4,7 +4,7 @@ module Cortex
4
4
  module Exceptions
5
5
  class CortexError < StandardError; end
6
6
 
7
- class CortexAPIError < CortexError
7
+ class ApiError < CortexError
8
8
  attr_accessor :http_status
9
9
 
10
10
  def initialize(message = 'Internal server error', http_status = :internal_server_error)
@@ -13,18 +13,26 @@ module Cortex
13
13
  end
14
14
  end
15
15
 
16
- class NotEmptyError < CortexAPIError
16
+ class NotEmptyError < ApiError
17
17
  def initialize(message = nil)
18
18
  super(message, :conflict)
19
19
  end
20
20
  end
21
21
 
22
- class ResourceConsumed < CortexAPIError
22
+ class ResourceConsumed < ApiError
23
23
  def initialize(message = 'Resource is in use by another resource and cannot be deleted', http_status = :unprocessable_entity)
24
24
  super(message)
25
25
  end
26
26
  end
27
27
 
28
+ class ConnectionFailed < APIError
29
+ attr_reader :base_url
30
+ def initialize(base_url = "http://api.cbcortex.com/api/v1/", message = nil, http_status = 599)
31
+ @base_url = base_url
32
+ super(message: message, http_status: http_status)
33
+ end
34
+ end
35
+
28
36
  class IdExpected < ArgumentError; end
29
37
 
30
38
  class IdNotExpected < ArgumentError; end
@@ -1,5 +1,5 @@
1
1
  module Cortex
2
2
  module Exceptions
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cortex-exceptions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Talent Development
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-20 00:00:00.000000000 Z
11
+ date: 2015-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  requirements: []
92
92
  rubyforge_project:
93
- rubygems_version: 2.2.2
93
+ rubygems_version: 2.4.5
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: Common exceptions used across the Cortex SOA infrastructure.