Exception: DeepL::Exceptions::NotFound

Inherits:
RequestError show all
Defined in:
lib/deepl/exceptions/not_found.rb

Instance Attribute Summary

Attributes inherited from RequestError

#request, #response

Attributes inherited from Error

#http_status_code

Instance Method Summary collapse

Methods inherited from Error

#should_retry?

Constructor Details

#initialize(response, request = nil, message = nil) ⇒ NotFound

Returns a new instance of NotFound.

Parameters:

  • message (String, nil) (defaults to: nil) —

    Replaces the API's message, for a not-found condition the SDK detects in a successful response.



11
12
13
14
# File 'lib/deepl/exceptions/not_found.rb', line 11

def initialize(response, request = nil, message = nil)
  super(response, request)
  @message = message
end

Instance Method Details

#to_s ⇒ Object



16
17
18
# File 'lib/deepl/exceptions/not_found.rb', line 16

def to_s
  (@message || body_message).to_s
end