taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

commit 988ce230c0b38995b72d006af89477b564fd92e2
parent efbe1dddecbdbf25029381bedc32269ffeeb6eea
Author: MS <ms@taler.net>
Date:   Thu,  8 Dec 2022 09:47:28 +0100

Sandbox API: error type.

Diffstat:
Mlibeufin/api-sandbox.rst | 51++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 50 insertions(+), 1 deletion(-)

diff --git 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" + } + +