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.
59 60 61 62 |
# File 'lib/cfoundry/errors.rb', line 59 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.
56 57 58 |
# File 'lib/cfoundry/errors.rb', line 56 def description @description end |
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
56 57 58 |
# File 'lib/cfoundry/errors.rb', line 56 def error_code @error_code end |
Class Method Details
.error_classes ⇒ Object
51 52 53 |
# File 'lib/cfoundry/errors.rb', line 51 def error_classes @error_classes ||= {} end |
Instance Method Details
#to_s ⇒ Object
Exception message.
65 66 67 68 69 70 71 72 73 |
# File 'lib/cfoundry/errors.rb', line 65 def to_s if error_code "#{error_code}: #{description}" elsif description description else super end end |