Exception: AgileCRMWrapper::Error
- Inherits:
-
StandardError
- Object
- StandardError
- AgileCRMWrapper::Error
- Defined in:
- lib/agilecrm-wrapper/error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(response, message = '') ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(response, message = '') ⇒ Error
Returns a new instance of Error.
22 23 24 25 |
# File 'lib/agilecrm-wrapper/error.rb', line 22 def initialize(response, = '') super() @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/agilecrm-wrapper/error.rb', line 3 def response @response end |
Class Method Details
.errors ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/agilecrm-wrapper/error.rb', line 10 def errors @errors ||= { 400 => AgileCRMWrapper::BadRequest, 401 => AgileCRMWrapper::Unauthorized, 404 => AgileCRMWrapper::NotFound, 405 => AgileCRMWrapper::MethodNotAllowed, 415 => AgileCRMWrapper::MediaTypeMismatch, 500 => AgileCRMWrapper::InternalServerError } end |
.from_response(response, message = '') ⇒ Object
6 7 8 |
# File 'lib/agilecrm-wrapper/error.rb', line 6 def from_response(response, = '') new(response, ) end |