Skip to content

Add only and except options to #error_handling #270

@ryz310

Description

@ryz310
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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions