summaryrefslogtreecommitdiff
path: root/sandbox/src/main/kotlin/tech/libeufin
diff options
context:
space:
mode:
authorMS <ms@taler.net>2023-01-20 21:05:37 +0100
committerMS <ms@taler.net>2023-01-20 21:05:37 +0100
commitf8b79329c9f2831af55b1e2f49c4ea3c779565d8 (patch)
tree76ca6fe818417c9df5dbfe0a6796210a6adfa320 /sandbox/src/main/kotlin/tech/libeufin
parentb5848e374e4ea6aab3da91b514cbd88f3742557a (diff)
downloadlibeufin-f8b79329c9f2831af55b1e2f49c4ea3c779565d8.tar.gz
libeufin-f8b79329c9f2831af55b1e2f49c4ea3c779565d8.tar.bz2
libeufin-f8b79329c9f2831af55b1e2f49c4ea3c779565d8.zip
Logging.
Prefer verbosity for failed TAN commands.
Diffstat (limited to 'sandbox/src/main/kotlin/tech/libeufin')
-rw-r--r--sandbox/src/main/kotlin/tech/libeufin/sandbox/CircuitApi.kt19
1 files 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
index 78870cf6..0f64efa6 100644
--- 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