Module: Trailblazer::Endpoint::Adapter::API::Errors::Handlers

Defined in:
lib/trailblazer/endpoint/adapter.rb

Instance Method Summary collapse

Instance Method Details

#handle_invalid_data(ctx, errors:) ⇒ Object



97
98
99
# File 'lib/trailblazer/endpoint/adapter.rb', line 97

def handle_invalid_data(ctx, errors:, **)
  errors.message = "The submitted data is invalid."
end

#handle_not_authenticated(ctx, errors:) ⇒ Object



89
90
91
# File 'lib/trailblazer/endpoint/adapter.rb', line 89

def handle_not_authenticated(ctx, errors:, **)
  errors.message = "Authentication credentials were not provided or are invalid."
end

#handle_not_authorized(ctx, errors:) ⇒ Object



93
94
95
# File 'lib/trailblazer/endpoint/adapter.rb', line 93

def handle_not_authorized(ctx, errors:, **)
  errors.message = "Action not allowed due to a policy setting."
end