You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AWS Lambda extension currently handles exceptions thrown by RequestHandler implementations in a uniform manner by logging the execution failure along with the stacktrace. In some cases, however, raising an exception is the expected way to provide a negative response to the caller - e.g. https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-authentication.html#aws-lambda-triggers-pre-authentication-example. In these cases, it's undesirable to have the exception logged. Suppressing the AbstractLambdaPollLoop logger via configuration is an option, of course, but then you have to be sure to catch and log any exceptions you actually want to report in your handler code.
It would be great if the logic in the poll loop could make a determination about whether or not to log the exception in a configurable/programmable way.
Implementation ideas
My first thought is to introduce a specialized RuntimeException type that developers can throw directly, or extend with their own exceptions. This makes the logic in AbstractLambdaPollLoop trivial, but would mean writing Quarkus-specific handlers.
An alternative would be to allow the configuration of arbitrary exceptions by class name that the extensions should ignore.
The text was updated successfully, but these errors were encountered:
Description
The AWS Lambda extension currently handles exceptions thrown by
RequestHandler
implementations in a uniform manner by logging the execution failure along with the stacktrace. In some cases, however, raising an exception is the expected way to provide a negative response to the caller - e.g. https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-authentication.html#aws-lambda-triggers-pre-authentication-example. In these cases, it's undesirable to have the exception logged. Suppressing theAbstractLambdaPollLoop
logger via configuration is an option, of course, but then you have to be sure to catch and log any exceptions you actually want to report in your handler code.It would be great if the logic in the poll loop could make a determination about whether or not to log the exception in a configurable/programmable way.
Implementation ideas
My first thought is to introduce a specialized
RuntimeException
type that developers can throw directly, or extend with their own exceptions. This makes the logic inAbstractLambdaPollLoop
trivial, but would mean writing Quarkus-specific handlers.An alternative would be to allow the configuration of arbitrary exceptions by class name that the extensions should ignore.
The text was updated successfully, but these errors were encountered: