From 2e486a8aa0558c1b39473b5b33821caae844e746 Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser <23085769+hiddenalpha@users.noreply.github.com> Date: Wed, 3 Jan 2024 16:55:01 +0100 Subject: [PATCH] [SDCISA-13736] We're not allowed to pass any more error details to that KISS handler. Have to fallback to log-only. --- .../org/swisspush/reststorage/RestStorageHandler.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/swisspush/reststorage/RestStorageHandler.java b/src/main/java/org/swisspush/reststorage/RestStorageHandler.java index 79c08f7..467926b 100644 --- a/src/main/java/org/swisspush/reststorage/RestStorageHandler.java +++ b/src/main/java/org/swisspush/reststorage/RestStorageHandler.java @@ -63,7 +63,10 @@ public RestStorageHandler(Vertx vertx, final Logger log, final Storage storage, Result result = checkHttpAuthenticationConfiguration(config); if(result.isErr()) { - router.route().handler(ctx -> respondWith(ctx.response(), StatusCode.INTERNAL_SERVER_ERROR, "ERR_hXECANxwAgCUQIAK: " + result.getErr())); + router.route().handler(ctx -> { + log.warn("router.route()", new Exception(result.getErr())); + respondWith(ctx.response(), StatusCode.INTERNAL_SERVER_ERROR, result.getErr()); + }); } else if (result.getOk()) { AuthenticationProvider authProvider = new ModuleConfigurationAuthentication(config); router.route().handler(BasicAuthHandler.create(authProvider)); @@ -602,8 +605,8 @@ private void storageExpand(RoutingContext ctx) { } ResourceNameUtil.replaceColonsAndSemiColonsInList(subResourceNames); } catch (RuntimeException ex) { - log.warn("Happy stacktrace just for you", ex); - respondWithBadRequest(ctx.request(), "Bad Request: Unable to parse body of storageExpand POST request: "+ ex.getMessage()); + log.warn("KISS handler is not interested in error details. I'll report them here then.", ex); + respondWithBadRequest(ctx.request(), "Bad Request: Unable to parse body of storageExpand POST request"); return; }