Class: Sappy::Responses::ErrorResponse
- Inherits:
-
Object
- Object
- Sappy::Responses::ErrorResponse
- Defined in:
- lib/sappy/responses/error.rb
Defined Under Namespace
Classes: AuthenticationError, Error
Instance Method Summary collapse
-
#initialize(xml) ⇒ ErrorResponse
constructor
A new instance of ErrorResponse.
Constructor Details
#initialize(xml) ⇒ ErrorResponse
Returns a new instance of ErrorResponse.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/sappy/responses/error.rb', line 7 def initialize(xml) err = xml["err"] = err.first["msg"] case code = err.first["code"] when "AUTH_EXPIRED" raise AuthenticationExpired, when "AUTH_ERR" raise AuthenticationError, else raise Error, "Unknown error[#{code}]: #{}" end end |