commit f8b79329c9f2831af55b1e2f49c4ea3c779565d8
parent b5848e374e4ea6aab3da91b514cbd88f3742557a
Author: MS <ms@taler.net>
Date: Fri, 20 Jan 2023 21:05:37 +0100
Logging.
Prefer verbosity for failed TAN commands.
Diffstat:
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/CircuitApi.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/CircuitApi.kt
@@ -390,10 +390,15 @@ fun circuitApi(circuitRoute: Route) {
message = op.tan
)
} catch (e: Exception) {
- throw internalServerError("E-mail TAN command threw exception: ${e.message}")
+ throw internalServerError(
+ "Sending the e-mail TAN failed for ${customer.email}." +
+ " The command threw this exception: ${e.message}"
+ )
}
if (!isSuccessful)
- throw internalServerError("E-mail TAN command failed.")
+ throw internalServerError(
+ "E-mail TAN command failed for ${customer.email}."
+ )
}
SupportedTanChannels.SMS.name -> {
val isSuccessful = try {
@@ -411,10 +416,14 @@ fun circuitApi(circuitRoute: Route) {
)
} catch (e: Exception) {
- throw internalServerError("SMS TAN command threw exception: ${e.message}")
+ throw internalServerError(
+ "Sending the SMS TAN failed for ${customer.phone}." +
+ " The command threw this exception: ${e.message}"
+ )
}
if (!isSuccessful)
- throw internalServerError("SMS TAN command failed.")
+ throw internalServerError(
+ "SMS TAN command failed for ${customer.phone}.")
}
SupportedTanChannels.FILE.name -> {
try {
@@ -425,7 +434,7 @@ fun circuitApi(circuitRoute: Route) {
}
}
else ->
- throw internalServerError("The bank didn't catch a unsupported TAN channel: $tanChannel.")
+ throw internalServerError("The bank tried an unsupported TAN channel: $tanChannel.")
}
call.respond(HttpStatusCode.Accepted, object {val uuid = op.uuid})
return@post