libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit 8e2c62b903e5d33b7a0cc4375c6ed262d1ecf0e0
parent 08c89e11591959b6d303ae530a5c6619930cea4b
Author: MS <ms@taler.net>
Date:   Thu, 14 Jan 2021 10:11:19 +0100

Avoid stack-traces on managed exceptions.

Diffstat:
Mintegration-tests/tests.py | 7+++----
Mnexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt | 9+++++----
2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/integration-tests/tests.py b/integration-tests/tests.py @@ -127,10 +127,9 @@ def teardown_function(): def test_env(make_crdt_payment, make_taler_facade): print("Nexus and Sandbox are up and running!\n") - print(f"Nexus URL: {NEXUS_URL}") - print(f"Sandbox URL: {SANDBOX_URL}") - print(f"Username/password active at Nexus: {PERSONA.nexus.username}/{PERSONA.nexus.password}") - print(f"Bank connection name: {PERSONA.nexus.bank_connection}") + print("Env-setter for the CLI:") + print(f"\texport NEXUS_BASE_URL={NEXUS_URL} NEXUS_USERNAME={PERSONA.nexus.username} NEXUS_PASSWORD={PERSONA.nexus.password}") + print(f"\nBank connection name: {PERSONA.nexus.bank_connection}") print(f"Imported bank account label: {PERSONA.nexus.bank_label}") try: input("\npress enter to stop LibEuFin test environment ...") diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/server/NexusServer.kt @@ -46,6 +46,7 @@ import io.ktor.response.respondText import io.ktor.routing.* import io.ktor.server.engine.embeddedServer import io.ktor.server.netty.Netty +import io.ktor.util.error import io.ktor.utils.io.ByteReadChannel import io.ktor.utils.io.jvm.javaio.toByteReadChannel import io.ktor.utils.io.jvm.javaio.toInputStream @@ -252,7 +253,7 @@ fun serverMain(dbName: String, host: String, port: Int) { } install(StatusPages) { exception<NexusError> { cause -> - logger.error("Exception while handling '${call.request.uri}'", cause) + logger.error("Caught exception while handling '${call.request.uri} (${cause.reason})") call.respond( status = cause.statusCode, message = NexusErrorJson( @@ -264,7 +265,7 @@ fun serverMain(dbName: String, host: String, port: Int) { ) } exception<EbicsProtocolError> { cause -> - logger.error("Exception while handling '${call.request.uri}'", cause) + logger.error("Caught exception while handling '${call.request.uri}' (${cause.reason})") call.respond( cause.httpStatusCode, NexusErrorJson( @@ -276,8 +277,8 @@ fun serverMain(dbName: String, host: String, port: Int) { ) } exception<Exception> { cause -> - logger.error("Uncaught exception while handling '${call.request.uri}'", cause) - logger.error(cause.toString()) + logger.error("Uncaught exception while handling '${call.request.uri}'") + logger.error(cause.stackTrace.toString()) call.respond( NexusErrorJson( error = NexusErrorDetailJson(