Exception: SimpleCrowd::CrowdError
- Inherits:
-
StandardError
- Object
- StandardError
- SimpleCrowd::CrowdError
- Defined in:
- lib/simple_crowd/crowd_error.rb
Instance Attribute Summary collapse
-
#original ⇒ Object
readonly
Returns the value of attribute original.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(original, message = nil) ⇒ CrowdError
constructor
A new instance of CrowdError.
- #type?(type) ⇒ Boolean
Constructor Details
#initialize(original, message = nil) ⇒ CrowdError
Returns a new instance of CrowdError.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/simple_crowd/crowd_error.rb', line 7 def initialize(original, =nil) @original = original if original.is_a?(Savon::SOAP::Fault) fault = original.to_hash[:fault] || {} @response = original.http @type = fault[:detail].keys.first rescue :fault = fault[:faultstring] if .blank? elsif original.is_a?(Savon::HTTP::Error) @response = original.http @type = :http end = original.to_s if .blank? super end |
Instance Attribute Details
#original ⇒ Object (readonly)
Returns the value of attribute original.
5 6 7 |
# File 'lib/simple_crowd/crowd_error.rb', line 5 def original @original end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/simple_crowd/crowd_error.rb', line 3 def response @response end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/simple_crowd/crowd_error.rb', line 4 def type @type end |
Instance Method Details
#type?(type) ⇒ Boolean
24 25 26 |
# File 'lib/simple_crowd/crowd_error.rb', line 24 def type? type @type == type.to_sym end |