From 274767d89b502c5f1f5b427488aafea00a95c9a9 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Sun, 2 Jun 2024 21:27:20 +0200 Subject: [PATCH] [FEAT] add some Logs when fail --- src/org/kar/archidata/catcher/FailExceptionCatcher.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/org/kar/archidata/catcher/FailExceptionCatcher.java b/src/org/kar/archidata/catcher/FailExceptionCatcher.java index 9c5ccd5..ceaa08e 100644 --- a/src/org/kar/archidata/catcher/FailExceptionCatcher.java +++ b/src/org/kar/archidata/catcher/FailExceptionCatcher.java @@ -13,11 +13,12 @@ public class FailExceptionCatcher implements ExceptionMapper { @Override public Response toResponse(final FailException exception) { - LOGGER.warn("Catch FailException:"); + LOGGER.warn("Catch FailException: {}", exception.getLocalizedMessage()); final RestErrorResponse ret = build(exception); LOGGER.error("Error UUID={}", ret.uuid); - // Not display backtrace ==> this may be a normal case ... - // exception.printStackTrace(); + if (exception.exception != null) { + exception.exception.printStackTrace(); + } return Response.status(exception.status).entity(ret).type(MediaType.APPLICATION_JSON).build(); }