Class: Postmen::RequestError
- Extended by:
- Forwardable
- Defined in:
- lib/postmen/errors.rb
Overview
Generic exception raised if the API returns an error
Instance Method Summary collapse
-
#code ⇒ Object
Internal API error code.
-
#details ⇒ Object
Returns details for the request error.
-
#initialize(request) ⇒ RequestError
constructor
A new instance of RequestError.
-
#message ⇒ Object
Returns human-readable error message.
-
#retryable? ⇒ Boolean
Indicates whether request is retryable.
Constructor Details
#initialize(request) ⇒ RequestError
Returns a new instance of RequestError.
11 12 13 |
# File 'lib/postmen/errors.rb', line 11 def initialize(request) @request = request end |
Instance Method Details
#code ⇒ Object
Internal API error code
29 30 31 |
# File 'lib/postmen/errors.rb', line 29 def code [:code] end |
#details ⇒ Object
Returns details for the request error
23 24 25 |
# File 'lib/postmen/errors.rb', line 23 def details [:details] end |
#message ⇒ Object
Returns human-readable error message
35 36 37 |
# File 'lib/postmen/errors.rb', line 35 def [:message] end |
#retryable? ⇒ Boolean
Indicates whether request is retryable.
17 18 19 |
# File 'lib/postmen/errors.rb', line 17 def retryable? .fetch(:retryable, false) end |