module LinkedRails::Controller::ErrorHandling::ClassMethods

Public Instance Methods

error_status_codes() click to toggle source
# File lib/linked_rails/controller/error_handling.rb, line 62
def error_status_codes # rubocop:disable Metrics/MethodLength
  @error_status_codes ||= {
    'ActionController::ParameterMissing' => 422,
    'ActionController::RoutingError' => 404,
    'ActionController::UnpermittedParameters' => 422,
    'ActiveRecord::RecordNotFound' => 404,
    'ActiveRecord::RecordNotUnique' => 304,
    'Doorkeeper::Errors::InvalidGrantReuse' => 422,
    'LinkedRails::Auth::Errors::Expired' => 410,
    'LinkedRails::Auth::Errors::Unauthorized' => 401,
    'Pundit::NotAuthorizedError' => 403
  }
end