class Moneybird::Middleware::ErrorHandling
Constants
- ERROR_MAP
Public Instance Methods
on_complete(response)
click to toggle source
# File lib/moneybird/middleware/error_handling.rb, line 19 def on_complete(response) key = response[:status].to_i raise ERROR_MAP[key], response_values(response) if ERROR_MAP.key? key end
response_values(response)
click to toggle source
# File lib/moneybird/middleware/error_handling.rb, line 24 def response_values(response) { status: response.status, headers: response.response_headers, body: response.body } end