my_api_client
my_api_client copied to clipboard
Add `only` and `except` options to `#error_handling`
class SomeApiClient < MyApiClient::Base
endpoint 'https://example.com'
error_handling status_code: 400, raise: Errors::BadRequest, except: :create_resource
error_handling status_code: 404, raise: Errors::NotFound, only: :get_resource
def get_resource
get 'path/to/resource'
end
def create_resource(body)
post 'path/to/resource', body: body
end
end