From 6ae7c6bcf1847c963145df074a956a8d2829cd93 Mon Sep 17 00:00:00 2001 From: Jens Kutzsche Date: Wed, 4 May 2022 22:31:33 +0200 Subject: [PATCH] chore: improves logging to find a hidden NPE --- .../java/iris/client_bff/status/eps/EPSStatusClient.java | 1 + .../java/iris/client_bff/status/web/AppStatusController.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/iris-client-bff/src/main/java/iris/client_bff/status/eps/EPSStatusClient.java b/iris-client-bff/src/main/java/iris/client_bff/status/eps/EPSStatusClient.java index 2b7abb097..0bd7d2da2 100644 --- a/iris-client-bff/src/main/java/iris/client_bff/status/eps/EPSStatusClient.java +++ b/iris-client-bff/src/main/java/iris/client_bff/status/eps/EPSStatusClient.java @@ -42,6 +42,7 @@ public Apps getAvailableApps() { return epsRpcClient.invoke(methodName, null, Directory.class).entries().stream() .filter(directoryEntry -> directoryEntry.groups().contains("checkin-apps")) + .peek(System.out::println) .map(DirectoryEntry::name) .map(App::new) .collect(collectingAndThen(toList(), Apps::new)); diff --git a/iris-client-bff/src/main/java/iris/client_bff/status/web/AppStatusController.java b/iris-client-bff/src/main/java/iris/client_bff/status/web/AppStatusController.java index 6cb8321d1..39d5c89f1 100644 --- a/iris-client-bff/src/main/java/iris/client_bff/status/web/AppStatusController.java +++ b/iris-client-bff/src/main/java/iris/client_bff/status/web/AppStatusController.java @@ -8,6 +8,7 @@ import iris.client_bff.status.web.AppStatusController.AppStatusInfo.Info; import lombok.AllArgsConstructor; import lombok.Value; +import lombok.extern.slf4j.Slf4j; import java.util.List; @@ -27,6 +28,7 @@ @RequestMapping("/status/checkin-apps") @Validated @AllArgsConstructor +@Slf4j public class AppStatusController { private StatusService statusService; @@ -37,6 +39,9 @@ public List getApps() { try { return statusService.getApps().toList(); } catch (Exception e) { + + log.error("Can't get apps from StatusService: ", e); + throw new ResponseStatusException(HttpStatus.BAD_REQUEST, e.getMessage()); } }