Exception: CFoundry::APIError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- CFoundry::APIError
- Defined in:
- lib/cfoundry/errors.rb
Overview
Exception representing errors returned by the API.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(error_code = nil, description = nil) ⇒ APIError
constructor
Create an APIError with a given error code and description.
-
#to_s ⇒ Object
Exception message.
Constructor Details
#initialize(error_code = nil, description = nil) ⇒ APIError
Create an APIError with a given error code and description.
45 46 47 48 |
# File 'lib/cfoundry/errors.rb', line 45 def initialize(error_code = nil, description = nil) @error_code = error_code @description = description end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
42 43 44 |
# File 'lib/cfoundry/errors.rb', line 42 def description @description end |
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
42 43 44 |
# File 'lib/cfoundry/errors.rb', line 42 def error_code @error_code end |
Class Method Details
.error_classes ⇒ Object
37 38 39 |
# File 'lib/cfoundry/errors.rb', line 37 def error_classes @error_classes ||= {} end |
Instance Method Details
#to_s ⇒ Object
Exception message.
51 52 53 54 55 56 57 58 59 |
# File 'lib/cfoundry/errors.rb', line 51 def to_s if error_code "#{error_code}: #{description}" elsif description description else super end end |