Exception: Omie::Error

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/omie/error.rb

Overview

This is the base Omie exception class. Rescue it if you want to catch any exceptions that your request might raise. In addition to the message, it may receive the response, a RestClient::Response object that can be used to improve the error messages.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, response = nil) ⇒ Error

Initialize the exception with the message and the request’s response and call the #after_initialize callback



13
14
15
16
17
# File 'lib/omie/error.rb', line 13

def initialize(message = nil, response = nil)
  @message = message
  @response = response
  after_initialize
end

Instance Attribute Details

#messageObject

Returns the value of attribute message.



9
10
11
# File 'lib/omie/error.rb', line 9

def message
  @message
end

#responseObject

Returns the value of attribute response.



9
10
11
# File 'lib/omie/error.rb', line 9

def response
  @response
end

Instance Method Details

#after_initializeObject

Callback to be overridden by underlying classes



20
# File 'lib/omie/error.rb', line 20

def after_initialize; end