Exception: Teems::ApiError
Overview
Error raised when a Teams API request fails (4xx/5xx responses)
Instance Attribute Summary collapse
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
- #forbidden? ⇒ Boolean
-
#initialize(message = nil, status_code: nil) ⇒ ApiError
constructor
A new instance of ApiError.
- #not_found? ⇒ Boolean
- #rate_limited? ⇒ Boolean
- #unauthorized? ⇒ Boolean
Constructor Details
#initialize(message = nil, status_code: nil) ⇒ ApiError
Returns a new instance of ApiError.
21 22 23 24 |
# File 'lib/teems.rb', line 21 def initialize( = nil, status_code: nil) @status_code = status_code super() end |
Instance Attribute Details
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
19 20 21 |
# File 'lib/teems.rb', line 19 def status_code @status_code end |
Instance Method Details
#forbidden? ⇒ Boolean
28 |
# File 'lib/teems.rb', line 28 def forbidden? = status_code == 403 |
#not_found? ⇒ Boolean
26 |
# File 'lib/teems.rb', line 26 def not_found? = status_code == 404 |
#rate_limited? ⇒ Boolean
29 |
# File 'lib/teems.rb', line 29 def rate_limited? = status_code == 429 |
#unauthorized? ⇒ Boolean
27 |
# File 'lib/teems.rb', line 27 def = status_code == 401 |