gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-util] branch master updated: update error codes


From: gnunet
Subject: [taler-taler-util] branch master updated: update error codes
Date: Fri, 03 Apr 2020 21:14:52 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository taler-util.

The following commit(s) were added to refs/heads/master by this push:
     new 5e91a4d  update error codes
5e91a4d is described below

commit 5e91a4d3dfc9c5288237d1e2bc11c1bf11c76ff8
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Apr 3 21:14:49 2020 +0200

    update error codes
---
 taler/util/errorcodes.py | 126 ++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 97 insertions(+), 29 deletions(-)

diff --git a/taler/util/errorcodes.py b/taler/util/errorcodes.py
index e2e4f1e..80494ab 100644
--- a/taler/util/errorcodes.py
+++ b/taler/util/errorcodes.py
@@ -1667,7 +1667,7 @@ ec._add_ec(
     """
     The exchange failed to provide a meaningful response
     to a /deposit request.  This response is provided
-    with HTTP status code #MHD_HTTP_DEPENDENCY_FAILED, or
+    with HTTP status code #MHD_HTTP_FAILED_DEPENDENCY, or
     #MHD_HTTP_CONFLICT in case the exchange reports
     #TALER_EC_DEPOSIT_INSUFFICIENT_FUNDS (aka double spending).
     """,
@@ -1737,8 +1737,9 @@ ec._add_ec(
     "PAY_PAYMENT_INSUFFICIENT_DUE_TO_FEES",
     2108,
     """
-    After considering deposit fees, the payment is insufficient
-    to satisfy the required amount for the contract.
+    After considering deposit and wire fees, the payment is insufficient
+    to satisfy the required amount for the contract.  The client should
+    revisit the logic used to calculate fees it must cover.
     This response is provided
     with HTTP status code #MHD_HTTP_BAD_REQUEST.
     """,
@@ -1748,7 +1749,7 @@ ec._add_ec(
     "PAY_PAYMENT_INSUFFICIENT",
     2109,
     """
-    While the merchant is happy to cover all applicable deposit fees,
+    Even if we do not consider deposit and wire fees,
     the payment is insufficient to satisfy the required amount for
     the contract.  This response is provided with HTTP status code
     #MHD_HTTP_BAD_REQUEST.
@@ -1776,12 +1777,15 @@ ec._add_ec(
 )
 
 ec._add_ec(
-    "PAY_MERCHANT_SIGNATURE_INVALID",
-    2113,
+    "PAY_EXCHANGE_LOOKUP_FAILED",
+    2112,
     """
-    The signature over the contract of the merchant
-    was invalid. This response is provided with HTTP status code
-    #MHD_HTTP_BAD_REQUEST.
+    When we tried to find information about the exchange
+    to issue the deposit, we failed.  This usually only
+    happens if the merchant backend is somehow unable to
+    get its own HTTP client logic to work.
+    This response is provided
+    with HTTP status code #MHD_HTTP_INTERNAL_SERVER_ERROR.
     """,
 )
 
@@ -1789,9 +1793,11 @@ ec._add_ec(
     "PAY_REFUND_DEADLINE_PAST_WIRE_TRANSFER_DEADLINE",
     2114,
     """
-    The refund deadline was after the transfer deadline.
+    The refund deadline in the contract is after the
+    transfer deadline.
     This response is provided with HTTP status code
-    #MHD_HTTP_BAD_REQUEST.
+    #MHD_HTTP_INTERNAL_SERVER_ERROR as this should have
+    been caught when the offer was first setup.
     """,
 )
 
@@ -1809,8 +1815,8 @@ ec._add_ec(
     "PAY_DB_FETCH_PAY_ERROR",
     2116,
     """
-    The merchant failed to fetch the merchant's previous state with
-    respect to a /pay request from its database.  This response is
+    The merchant failed to fetch the contract terms from the
+    merchant's database.  This response is
     provided with HTTP status code #MHD_HTTP_INTERNAL_SERVER_ERROR.
     """,
 )
@@ -1825,15 +1831,6 @@ ec._add_ec(
     """,
 )
 
-ec._add_ec(
-    "PAY_DB_TRANSACTION_ID_CONFLICT",
-    2118,
-    """
-    The transaction ID was used for a conflicing transaction before.
-    This response is
-    provided with HTTP status code #MHD_HTTP_BAD_REQUEST.
-    """,
-)
 
 ec._add_ec(
     "PAY_DB_STORE_TRANSACTION_ERROR",
@@ -1862,7 +1859,7 @@ ec._add_ec(
     """
     The payment is too late, the offer has expired.
     This response is
-    provided with HTTP status code #MHD_HTTP_BAD_REQUEST.
+    provided with HTTP status code #MHD_HTTP_GONE.
     """,
 )
 
@@ -1971,6 +1968,28 @@ ec._add_ec(
     """,
 )
 
+ec._add_ec(
+    "PAY_REFUNDED",
+    2132,
+    """
+    The contract was not fully paid because of refunds.
+    Note that clients MAY treat this as paid if, for example,
+    contracts must be executed despite of refunds.
+    This response is provided
+    with HTTP status code #MHD_HTTP_PAYMENT_REQUIRED.
+    """,
+)
+
+ec._add_ec(
+    "PAY_REFUNDS_EXCEED_PAYMENTS",
+    2133,
+    """
+    According to our database, we have refunded more than we
+    were paid (which should not be possible).
+    This response is provided
+    with HTTP status code #MHD_HTTP_INTERNAL_SERVER_ERROR.
+    """,
+)
 ec._add_ec(
     "HISTORY_TIMESTAMP_OVERFLOW",
     2200,
@@ -2353,7 +2372,7 @@ ec._add_ec(
     The backend knows the instance that was supposed to support the
     tip, but it was not configured for tipping (i.e. has no exchange
     associated with it).  Likely to be a configuration
-    error. Returned with an HTTP status code of #MHD_HTTP_NOT_FOUND.
+    error. Returned with an HTTP status code of #MHD_HTTP_PRECONDITION_FAILED.
     """,
 )
 
@@ -2373,7 +2392,7 @@ ec._add_ec(
     """
     The reserve that was used to fund the tips was not found in the DB.
     Returned with an HTTP status code of
-    #MHD_HTTP_NOT_FOUND.
+    #MHD_HTTP_SERVICE_UNAVAILABLE.
     """,
 )
 
@@ -2385,7 +2404,8 @@ ec._add_ec(
     tip, and it was configured for tipping. However, the funds
     remaining are insufficient to cover the tip, and the merchant
     should top up the reserve.
-    Returned with an HTTP status code of "PRECONDITION FAILED".
+    Returned with an HTTP status code of
+    #MHD_HTTP_PRECONDITION FAILED.
     """,
 )
 
@@ -2414,6 +2434,8 @@ ec._add_ec(
     2707,
     """
     The backend failed to obtain a reserve status from the exchange.
+    This response is provided
+    with HTTP status code #MHD_HTTP_FAILED_DEPENDENCY.
     """,
 )
 
@@ -2422,6 +2444,8 @@ ec._add_ec(
     2708,
     """
     The backend got an empty (!) reserve history from the exchange.
+    This response is provided
+    with HTTP status code #MHD_HTTP_FAILED_DEPENDENCY.
     """,
 )
 
@@ -2431,15 +2455,19 @@ ec._add_ec(
     """
     The backend got an invalid reserve history
     (fails to start with a deposit) from the exchange.
+    This response is provided
+    with HTTP status code #MHD_HTTP_FAILED_DEPENDENCY.
     """,
 )
 
 ec._add_ec(
-    "TIP_QUERY_RESERVE_HISTORY_INVALID_CURRENCY",
+    "TIP_QUERY_RESERVE_UNKNOWN_TO_EXCHANGE",
     2710,
     """
-    The backend got an reserve history
-    with a bad currency from the exchange.
+    The backend got an 404 response from the exchange
+    when it inquired about the reserve history.
+    The response is provided
+    with HTTP status code #MHD_HTTP_SERVICE_UNAVAILABLE.
     """,
 )
 
@@ -2449,6 +2477,8 @@ ec._add_ec(
     """
     The backend got a reserve with a currency that does not match
     the backend's currency.
+    The response is provided
+    with HTTP status code #MHD_HTTP_SERVICE_UNAVAILABLE.
     """,
 )
 
@@ -2458,6 +2488,8 @@ ec._add_ec(
     """
     The backend got a reserve history with amounts it cannot
     process (addition failure in deposits).
+    The response is provided
+    with HTTP status code #MHD_HTTP_FAILED_DEPENDENCY.
     """,
 )
 
@@ -2467,6 +2499,8 @@ ec._add_ec(
     """
     The backend got a reserve history with amounts it cannot
     process (addition failure in withdraw amounts).
+    The response is provided
+    with HTTP status code #MHD_HTTP_FAILED_DEPENDENCY.
     """,
 )
 
@@ -2476,6 +2510,8 @@ ec._add_ec(
     """
     The backend got a reserve history with amounts it cannot
     process (addition failure in closing amounts).
+    The response is provided
+    with HTTP status code #MHD_HTTP_FAILED_DEPENDENCY.
     """,
 )
 
@@ -2495,6 +2531,38 @@ ec._add_ec(
     """,
 )
 
+ec._add_ec(
+    "TIP_QUERY_RESERVE_HISTORY_FAILED",
+    2717,
+    """
+    The backend got an unexpected resever history reply from the exchange.
+    This response is provided
+    with HTTP status code #MHD_HTTP_FAILED_DEPENDENCY.
+    """,
+)
+
+ec._add_ec(
+    "TIP_QUERY_RESERVE_HISTORY_ARITHMETIC_ISSUE_RECOUP",
+    2718,
+    """
+    The backend got a reserve history with amounts it cannot
+    process (addition failure in withdraw amounts).
+    The response is provided
+    with HTTP status code #MHD_HTTP_FAILED_DEPENDENCY.
+    """,
+)
+
+ec._add_ec(
+    "TIP_QUERY_INSTANCE_DOES_NOT_TIP",
+    2719,
+    """
+    The backend knows the instance that was supposed to support the
+    tip, but it was not configured for tipping (i.e. has no exchange
+    associated with it).  Likely to be a configuration
+    error. Returned with an HTTP status code of #MHD_HTTP_PRECONDITION_FAILED.
+    """,
+)
+
 
 ec._add_ec(
     "TIP_ENABLE_DB_TRANSACTION_ERROR",

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]