commit 1e3e092725d11d8c1e1f76a6fec421606884dc72
parent cb7094fe27afb1ea1ecd4fcbda3d075c05f7aa16
Author: Antoine A <>
Date: Mon, 13 Nov 2023 23:37:48 +0000
Improve cashout API
Diffstat:
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/bank/src/main/kotlin/tech/libeufin/bank/CoreBankApi.kt b/bank/src/main/kotlin/tech/libeufin/bank/CoreBankApi.kt
@@ -552,8 +552,7 @@ private fun Routing.coreBankCashoutApi(db: Database, ctx: BankConfig) = conditio
process.exitValue()
}
if (exitValue != 0) {
- throw libeufinError(
- HttpStatusCode.BadGateway,
+ throw conflict(
"Tan channel script failure with exit value $exitValue",
TalerErrorCode.BANK_TAN_CHANNEL_SCRIPT_FAILED
)
diff --git a/bank/src/test/kotlin/CoreBankApiTest.kt b/bank/src/test/kotlin/CoreBankApiTest.kt
@@ -1073,7 +1073,7 @@ class CoreBankCashoutApiTest {
jsonBody(req) {
"tan_channel" to "email"
}
- }.assertStatus(HttpStatusCode.BadGateway, TalerErrorCode.BANK_TAN_CHANNEL_SCRIPT_FAILED)
+ }.assertConflict(TalerErrorCode.BANK_TAN_CHANNEL_SCRIPT_FAILED)
// Check OK
client.post("/accounts/customer/cashouts") {