azure-armrest 0.2.8 → 0.2.9

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: 83cc9a600096d0ba6960803745720f3db623e035
4
- data.tar.gz: 6dfc6c507bd13b8563c345c2c22a5076a0c4ab1e
3
+ metadata.gz: f3198a7b942784b49438efa209642a348299d234
4
+ data.tar.gz: e0512f7d077f2987e6ae1bc740871747bf8985fb
5
5
  SHA512:
6
- metadata.gz: 622474a14751ccc15e669c3a0502e124fd3e2500d3e7889ef5f759b547852d78f0a14cd8bb6cc6977fd2936e40a2c72c4db82d438a32ddd7052df7fc55d692a3
7
- data.tar.gz: 17440d8c5629a94c1f4e04a98046939537ffa8996a843dc7d2998796a6f76a3089434e79489b899d260589dc102c507188595bb937d233e80a3d010643f346be
6
+ metadata.gz: 455068f550d8ba2048788cee68ed2064d11e89b1a86c72b04cc02840b56b2b8c274cc7365d0c6c8c23943006634a7fc3bf7860288db1aabc351c01df8dff39b3
7
+ data.tar.gz: 7e546e34a28f6457e2a909ad1597160fad83dd45651fa0b93bcc14fc66f7263fa65e26c410b7c6540f4cf71d56ea56f975a4db8e6e2cf2bc55ec047b72141365
data/CHANGES CHANGED
@@ -1,3 +1,6 @@
1
+ = 0.2.9 - 25-Aug-2016
2
+ * Backported PR #211 (exception class updates and specs).
3
+
1
4
  = 0.2.8 - 22-Jul-2016
2
5
  * Backported PR #188 (add list_all_private_images method).
3
6
  * Backported PR #194 (updated .travis.yml).
@@ -4,15 +4,30 @@ module Azure
4
4
  attr_accessor :cause
5
5
  attr_writer :message
6
6
 
7
+ # Create a new Armrest::Exception object. The +message+ should be an
8
+ # error string, while +cause_exception+ is typically set to the
9
+ # raw RestClient exception.
10
+ #
11
+ # You will not typically use this object directly.
12
+ #
7
13
  def initialize(message = nil, cause_exception = nil)
8
14
  @message = message
9
15
  @cause = cause_exception
10
16
  end
11
17
 
18
+ # The stringified version (message) of the exception.
19
+ #
12
20
  def to_s
13
- message
21
+ if cause
22
+ "#{message} (cause: #{cause})"
23
+ else
24
+ message
25
+ end
14
26
  end
15
27
 
28
+ # The error message or, if the message is not set, the name of the
29
+ # exception class.
30
+ #
16
31
  def message
17
32
  @message || self.class.name
18
33
  end
@@ -21,16 +36,24 @@ module Azure
21
36
  class ApiException < Exception
22
37
  attr_accessor :code
23
38
 
39
+ # Create a new ApiException class. The +code+ is the error code.
40
+ #
41
+ # This class serves as the parent
24
42
  def initialize(code, message, cause_exception)
25
43
  @code = code
26
44
  super(message, cause_exception)
27
45
  end
28
46
 
47
+ # A stringified version of the error. If self is a plain ApiException,
48
+ # then the cause is included to aid in debugging.
49
+ #
29
50
  def to_s
30
- "[#{code}] #{message}"
51
+ "[#{code}] #{super}"
31
52
  end
32
53
  end
33
54
 
55
+ # A list of predefined exceptions that we wrap around RestClient exceptions.
56
+
34
57
  class ResourceNotFoundException < ApiException; end
35
58
 
36
59
  class BadRequestException < ApiException; end
@@ -1,5 +1,5 @@
1
1
  module Azure
2
2
  module Armrest
3
- VERSION = '0.2.8'.freeze
3
+ VERSION = '0.2.9'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: azure-armrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-07-22 00:00:00.000000000 Z
14
+ date: 2016-08-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: json