From 23a1a804411a176d2f1f1d56ea82e3a920fde4ea Mon Sep 17 00:00:00 2001 From: Pavel Vetokhin Date: Sun, 17 Mar 2024 11:09:17 +0300 Subject: [PATCH] Add exception message --- .../main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java | 3 ++- .../main/kotlin/smecalculus/bezmen/core/SepulkaServiceImpl.kt | 2 +- tool/testing/src/main/resources/log4j2.xml | 2 ++ tool/testing/src/main/resources/logback.xml | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/sepuling-java/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java b/app/sepuling-java/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java index 33ad4de4..52bc7a7f 100644 --- a/app/sepuling-java/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java +++ b/app/sepuling-java/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java @@ -41,6 +41,7 @@ public RegistrationResponse register(RegistrationRequest request) { public ViewingResponse view(SepulkaMessageDm.ViewingRequest request) { LOG.debug("Handling sepulka viewing request: {}", request); var state = dao.getBy(request.internalId()); - return state.map(factory::newMessage).orElseThrow(RuntimeException::new); + return state.map(factory::newMessage) + .orElseThrow(() -> new RuntimeException("NotFoundException")); } } diff --git a/app/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/core/SepulkaServiceImpl.kt b/app/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/core/SepulkaServiceImpl.kt index 31c1a9bd..7e8b3ff2 100644 --- a/app/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/core/SepulkaServiceImpl.kt +++ b/app/sepuling-kotlin/src/main/kotlin/smecalculus/bezmen/core/SepulkaServiceImpl.kt @@ -27,6 +27,6 @@ class SepulkaServiceImpl( override fun view(request: ViewingRequest): ViewingResponse { val state = dao.getBy(request.internalId) - return state?.let { factory.newMessage(it) } ?: throw RuntimeException() + return state?.let { factory.newMessage(it) } ?: throw RuntimeException("NotFoundException") } } diff --git a/tool/testing/src/main/resources/log4j2.xml b/tool/testing/src/main/resources/log4j2.xml index 36222c53..d50f1a5d 100644 --- a/tool/testing/src/main/resources/log4j2.xml +++ b/tool/testing/src/main/resources/log4j2.xml @@ -1,3 +1,4 @@ + @@ -6,6 +7,7 @@ + diff --git a/tool/testing/src/main/resources/logback.xml b/tool/testing/src/main/resources/logback.xml index 354ee23a..5e60d396 100644 --- a/tool/testing/src/main/resources/logback.xml +++ b/tool/testing/src/main/resources/logback.xml @@ -1,3 +1,4 @@ + @@ -5,7 +6,7 @@ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{1} - %msg%n - +