Exception: DeepL::Exceptions::Error
- Inherits:
-
StandardError
- Object
- StandardError
- DeepL::Exceptions::Error
- Defined in:
- lib/deepl/exceptions/error.rb
Direct Known Subclasses
ConnectionError, DocumentTranslationError, RequestError, TranslationMemoryJobError
Instance Attribute Summary collapse
-
#http_status_code ⇒ Integer?
readonly
HTTP status of the failed response,
nilif there was none.
Instance Method Summary collapse
-
#initialize(message = nil, http_status_code: nil, should_retry: false) ⇒ Error
constructor
A new instance of Error.
- #should_retry? ⇒ Boolean
Constructor Details
#initialize(message = nil, http_status_code: nil, should_retry: false) ⇒ Error
Returns a new instance of Error.
15 16 17 18 19 |
# File 'lib/deepl/exceptions/error.rb', line 15 def initialize( = nil, http_status_code: nil, should_retry: false) super() @http_status_code = http_status_code @should_retry = should_retry end |
Instance Attribute Details
#http_status_code ⇒ Integer? (readonly)
Returns HTTP status of the failed response, nil if there was none.
10 11 12 |
# File 'lib/deepl/exceptions/error.rb', line 10 def http_status_code @http_status_code end |
Instance Method Details
#should_retry? ⇒ Boolean
21 22 23 |
# File 'lib/deepl/exceptions/error.rb', line 21 def should_retry? @should_retry || false end |