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



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

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

#handle_not_authenticated(ctx, errors:) ⇒ Object



82
83
84
# File 'lib/trailblazer/endpoint/adapter.rb', line 82

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

#handle_not_authorized(ctx, errors:) ⇒ Object



86
87
88
# File 'lib/trailblazer/endpoint/adapter.rb', line 86

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