oass 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -51,11 +51,14 @@ module Oass
51
51
  def raise_errors(response)
52
52
  return if (error = response.css("Exception")).empty?
53
53
 
54
- case error.attribute("errorCode").value.to_i
54
+ code = error.attribute("errorCode").value.to_i
55
+ message = error.first.content
56
+
57
+ case code
55
58
  when 545
56
- raise Oass::NotFoundError.new error.first.content
59
+ raise Oass::NotFoundError.new message, :code => code
57
60
  else
58
- raise Oass::OASError.new error.first.content
61
+ raise Oass::OASError.new message, :code => code
59
62
  end
60
63
  end
61
64
  end
@@ -1,4 +1,12 @@
1
1
  module Oass
2
- class OASError < StandardError; end
2
+ class OASError < StandardError
3
+ attr_reader :code
4
+
5
+ def initialize(message, options = {})
6
+ super message
7
+ @code = options[:code]
8
+ end
9
+ end
10
+
3
11
  class NotFoundError < OASError; end
4
12
  end
@@ -1,3 +1,3 @@
1
1
  module Oass
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oass
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rodrigo Navarro
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-30 00:00:00 -03:00
18
+ date: 2011-06-01 00:00:00 -03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency