Exception: RepsClient::ServiceError
- Inherits:
-
StandardError
- Object
- StandardError
- RepsClient::ServiceError
- Defined in:
- lib/reps_client/errors.rb
Overview
Represents a server-side error returned by the REPS web service.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Class Method Summary collapse
-
.translate_fault(soap_error) ⇒ RepsClient::ServiceError
Translates a soap fault into the appropriate RepsClient error.
Instance Method Summary collapse
-
#initialize(message = nil, code = nil) ⇒ ServiceError
constructor
Creates a new error object.
Constructor Details
#initialize(message = nil, code = nil) ⇒ ServiceError
Creates a new error object.
11 12 13 14 |
# File 'lib/reps_client/errors.rb', line 11 def initialize(=nil, code=nil) super() @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
4 5 6 |
# File 'lib/reps_client/errors.rb', line 4 def code @code end |
Class Method Details
.translate_fault(soap_error) ⇒ RepsClient::ServiceError
Translates a soap fault into the appropriate RepsClient error.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/reps_client/errors.rb', line 20 def self.translate_fault(soap_error) fault = soap_error.to_hash[:fault] # set up defaults error_class = RepsClient::ServiceError if fault[:faultcode] == 'InvalidEnterpriseKey' error_class = RepsClient::InvalidEnterpriseKeyError end error_class.new(fault[:faultstring], fault[:faultcode]) end |