commit 7d2c532d9f67b20e76459ed2d80d03d59c810199 parent 14cdc271ef3bf861a23580a2204ebddab05a600f Author: MS <ms@taler.net> Date: Sat, 7 Jan 2023 13:37:04 +0100 Nexus HTTP status codes review. Supporting the "504 Gateway Timeout" response. Diffstat:
| M | nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt | | | 6 | +++++- |
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt @@ -46,8 +46,12 @@ private suspend inline fun HttpClient.postToBank(url: String, body: String): Str } } catch (e: ClientRequestException) { logger.error(e.message) + val returnStatus = if (e.response.status.value == HttpStatusCode.RequestTimeout.value) + HttpStatusCode.GatewayTimeout + else HttpStatusCode.BadGateway + throw NexusError( - HttpStatusCode.BadGateway, + returnStatus, e.message ) }