Exception: Ilovepdf::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/ilovepdf/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_response, custom_msg: nil) ⇒ ApiError

Returns a new instance of ApiError.



8
9
10
11
12
# File 'lib/ilovepdf/errors.rb', line 8

def initialize(http_response, custom_msg: nil)
  msg_to_use = custom_msg ? custom_msg : extract_error_text(http_response)
  super(msg_to_use)
  self.http_response = http_response
end

Instance Attribute Details

#http_responseObject

Returns the value of attribute http_response.



7
8
9
# File 'lib/ilovepdf/errors.rb', line 7

def http_response
  @http_response
end