Exception: ShedCloud::PartnerApi::PartnerApiError
- Inherits:
-
StandardError
- Object
- StandardError
- ShedCloud::PartnerApi::PartnerApiError
- Defined in:
- lib/shedcloud/partner_api/errors.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #forbidden? ⇒ Boolean
-
#initialize(message, status:, body: nil, code: nil) ⇒ PartnerApiError
constructor
A new instance of PartnerApiError.
- #not_found? ⇒ Boolean
- #rate_limited? ⇒ Boolean
- #unauthorized? ⇒ Boolean
Constructor Details
#initialize(message, status:, body: nil, code: nil) ⇒ PartnerApiError
Returns a new instance of PartnerApiError.
8 9 10 11 12 13 |
# File 'lib/shedcloud/partner_api/errors.rb', line 8 def initialize(, status:, body: nil, code: nil) @status = status @body = body @code = code super(()) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/shedcloud/partner_api/errors.rb', line 6 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
6 7 8 |
# File 'lib/shedcloud/partner_api/errors.rb', line 6 def code @code end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
6 7 8 |
# File 'lib/shedcloud/partner_api/errors.rb', line 6 def status @status end |
Instance Method Details
#forbidden? ⇒ Boolean
16 |
# File 'lib/shedcloud/partner_api/errors.rb', line 16 def forbidden? = status == 403 |
#not_found? ⇒ Boolean
17 |
# File 'lib/shedcloud/partner_api/errors.rb', line 17 def not_found? = status == 404 |
#rate_limited? ⇒ Boolean
18 |
# File 'lib/shedcloud/partner_api/errors.rb', line 18 def rate_limited? = status == 429 |
#unauthorized? ⇒ Boolean
15 |
# File 'lib/shedcloud/partner_api/errors.rb', line 15 def = status == 401 |