From 988ce230c0b38995b72d006af89477b564fd92e2 Mon Sep 17 00:00:00 2001 From: MS Date: Thu, 8 Dec 2022 09:47:28 +0100 Subject: Sandbox API: error type. --- libeufin/api-sandbox.rst | 51 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) (limited to 'libeufin') diff --git a/libeufin/api-sandbox.rst b/libeufin/api-sandbox.rst index 29affda9..0149d4d6 100644 --- a/libeufin/api-sandbox.rst +++ b/libeufin/api-sandbox.rst @@ -68,7 +68,11 @@ The following endpoints are served under ``/demobanks/default/customer-api``. One information was not available, the error message should inform about it. :http:statuscode:`403 Forbidden`: - A istitutional username was attempted, like ``admin`` or ``bank``. + A istitutional username was attempted, like ``admin`` or ``bank``. + :http:statuscode:`404 Bad request`: + Input data was invalid. For example, the client specified a invalid + phone number or e-mail. + .. http:delete:: /customers @@ -625,3 +629,48 @@ Transactions. The last Camt.053 document related to the bank account mentioned in the request body. + + +====== +Errors +====== + +The JSON type coming along a non 2xx response is the following: + +.. ts:def:: SandboxError + + interface SandboxError { + error: SandboxErrorDetail; + } + +.. ts:def:: SandboxErrorDetail + + interface SandboxErrorDetail { + + // String enum classifying the error. + type: ErrorType; + + // Human-readable error description. + message: string; + } + +.. ts:def:: ErrorType + + enum ErrorType { + /** + * This error can be related to a business operation, + * a non-existent object requested by the client, or + * even when the bank itself fails. + */ + SandboxError = "sandbox-error", + + /** + * It is the error type thrown by helper functions + * from the Util library. Those are used by both + * Sandbox and Nexus, therefore the actual meaning + * must be carried by the error 'message' field. + */ + UtilError = "util-error" + } + + -- cgit v1.2.3