Skip to content

Provide a way to differentiate armeria service's internal errors #5213

Description

@jrhee17

As an example, users may want to throw IllegalArgumentException from their own services.

However, they may want to return a different error code for

  1. IllegalArgumentException from their own services
  2. IllegalArgumentException from armeria's internal validation (i.e. missing param)

We may consider:

  • Allowing users to customize the default exception returned from armeria's internal logic
  • Also provide information on where the exception was thrown as a parameter in ServiceErrrorHandler#onServiceException
  • Just wrap all exceptions with a pre-defined Armeria exception

This doesn't necessarily have to be limited to AnnotatedService, but may be also applied to GrpcService, THttpService, GraphQlService, etc.

ref: https://discord.com/channels/1087271586832318494/1087272728177942629/1156905488672379000

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions