use of com.nexblocks.authguard.api.dto.entities.Error in project AuthGuard by AuthGuard.
the class ServerExceptionHandlers method configure.
@Override
public void configure(final Javalin app) {
app.exception(Exception.class, (e, context) -> {
log.error("An exception was thrown", e);
final String message = "An error occurred while processing request " + context.method() + " " + context.path();
context.status(500).json(new Error("", message));
});
app.exception(ServiceException.class, ExceptionHandlers::serviceException);
app.exception(ServiceAuthorizationException.class, ExceptionHandlers::serviceAuthorizationException);
app.exception(ServiceConflictException.class, ExceptionHandlers::serviceConflictException);
app.exception(RuntimeJsonException.class, ExceptionHandlers::jsonMappingException);
app.exception(RequestValidationException.class, ExceptionHandlers::requestValidationException);
app.exception(IdempotencyException.class, ExceptionHandlers::idempotencyException);
app.exception(TimeoutException.class, ExceptionHandlers::timeoutException);
app.exception(CompletionException.class, ExceptionHandlers::completionException);
}
Aggregations