Module: LinkedRails::Controller::ErrorHandling::ClassMethods

Defined in:
lib/linked_rails/controller/error_handling.rb

Instance Method Summary collapse

Instance Method Details

#error_status_codesObject

rubocop:disable Metrics/MethodLength



60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/linked_rails/controller/error_handling.rb', line 60

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