Exception: Typecast::ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- Typecast::ApiError
- Defined in:
- lib/typecast/errors.rb
Direct Known Subclasses
BadRequestError, InternalServerError, NotFoundError, PaymentRequiredError, RateLimitError, UnauthorizedError, UnprocessableEntityError
Instance Attribute Summary collapse
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(message, status_code, detail = nil) ⇒ ApiError
constructor
A new instance of ApiError.
Constructor Details
#initialize(message, status_code, detail = nil) ⇒ ApiError
Returns a new instance of ApiError.
5 6 7 8 9 |
# File 'lib/typecast/errors.rb', line 5 def initialize(, status_code, detail = nil) super(detail.nil? || detail.empty? ? : "#{}: #{detail}") @status_code = status_code @detail = detail end |
Instance Attribute Details
#detail ⇒ Object (readonly)
Returns the value of attribute detail.
3 4 5 |
# File 'lib/typecast/errors.rb', line 3 def detail @detail end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
3 4 5 |
# File 'lib/typecast/errors.rb', line 3 def status_code @status_code end |