libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit a2828b1d729f3d73da997b963808e9d520d79e13
parent a2f80383b1d6a48eeea05caf259a6016d0caeb8c
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Mon,  9 Mar 2020 14:48:53 +0100

Killing myriad of error types.

Diffstat:
Mnexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 65+----------------------------------------------------------------
1 file changed, 1 insertion(+), 64 deletions(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt @@ -320,69 +320,6 @@ fun main() { call.respondText("Internal server error.\n", ContentType.Text.Plain, HttpStatusCode.InternalServerError) } - exception<NotAnIdError> { cause -> - logger.error("Exception while handling '${call.request.uri}'", cause) - call.respondText("Bad request\n", ContentType.Text.Plain, HttpStatusCode.BadRequest) - } - - exception<BadBackup> { cause -> - logger.error("Exception while handling '${call.request.uri}'", cause) - call.respondText( - "Bad backup, or passphrase incorrect\n", - ContentType.Text.Plain, - HttpStatusCode.BadRequest - ) - } - - exception<UnparsableResponse> { cause -> - logger.error("Exception while handling '${call.request.uri}'", cause) - call.respondText( - "Could not parse bank response (${cause.message})\n", ContentType.Text.Plain, HttpStatusCode - .InternalServerError - ) - } - - exception<UnreachableBankError> { cause -> - logger.error("Exception while handling '${call.request.uri}'", cause) - call.respondText( - "Could not reach the bank\n", - ContentType.Text.Plain, - HttpStatusCode.InternalServerError - ) - } - - exception<SubscriberNotFoundError> { cause -> - logger.error("Exception while handling '${call.request.uri}'", cause) - call.respondText("Subscriber not found\n", ContentType.Text.Plain, HttpStatusCode.NotFound) - } - - exception<BadSignature> { cause -> - logger.error("Exception while handling '${call.request.uri}'", cause) - call.respondText( - "Signature verification unsuccessful\n", - ContentType.Text.Plain, - HttpStatusCode.NotAcceptable - ) - } - - exception<EbicsError> { cause -> - logger.error("Exception while handling '${call.request.uri}'", cause) - call.respondText( - "Bank gave EBICS-error response\n", - ContentType.Text.Plain, - HttpStatusCode.NotAcceptable - ) - } - - exception<BankKeyMissing> { cause -> - logger.error("Exception while handling '${call.request.uri}'", cause) - call.respondText( - "Impossible operation: get bank keys first\n", - ContentType.Text.Plain, - HttpStatusCode.NotAcceptable - ) - } - exception<javax.xml.bind.UnmarshalException> { cause -> logger.error("Exception while handling '${call.request.uri}'", cause) call.respondText( @@ -512,7 +449,7 @@ fun main() { EbicsAccountInfoEntity.find { EbicsAccountsInfoTable.subscriber eq id }.forEach { - val element = Pain001Entity.find { + Pain001Entity.find { Pain001Table.debtorAccount eq it.id.value }.forEach { ret.payments.add(