commit d75824cd235b81680ca9e38ad9e6bebb3e3a1010
parent 72c86420774da33ab9bc44ea0f288116c2c63193
Author: MS <ms@taler.net>
Date: Tue, 4 Apr 2023 13:56:34 +0200
logging
Diffstat:
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/CircuitApi.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/CircuitApi.kt
@@ -443,6 +443,7 @@ fun circuitApi(circuitRoute: Route) {
val amount_credit = "$FIAT_CURRENCY:$respAmountCredit"
val amount_debit = "${demobank.config.currency}:$respAmountDebit"
})
+ return@get
}
// Create a cash-out operation.
@@ -804,11 +805,13 @@ fun circuitApi(circuitRoute: Route) {
withBankFault = true // See comment "CUSTOMER AND BANK ACCOUNT INVARIANT".
)
val balance = getBalance(bankAccount)
- if (balance != BigDecimal.ZERO)
+ if (balance != BigDecimal.ZERO) {
+ logger.error("Account $resourceName has $balance balance. Won't delete it")
throw SandboxError(
HttpStatusCode.PreconditionFailed,
"Account $resourceName doesn't have zero balance. Won't delete it"
)
+ }
transaction {
bankAccount.delete()
customer.delete()
diff --git a/util/src/main/kotlin/strings.kt b/util/src/main/kotlin/strings.kt
@@ -186,7 +186,7 @@ fun parseUuid(maybeUuid: String): UUID {
val uuid = try {
UUID.fromString(maybeUuid)
} catch (e: Exception) {
- throw badRequest("$maybeUuid is an invalid UUID.")
+ throw badRequest("'$maybeUuid' is an invalid UUID.")
}
return uuid
}
\ No newline at end of file