gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] 01/02: show error hint if its found


From: gnunet
Subject: [taler-wallet-core] 01/02: show error hint if its found
Date: Mon, 06 Dec 2021 19:27:39 +0100

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

sebasjm pushed a commit to branch master
in repository wallet-core.

commit ce3ffbcd81b67c4a8e869b3392e6fdce44888300
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Mon Dec 6 13:37:01 2021 -0300

    show error hint if its found
---
 .../src/components/ErrorTalerOperation.tsx                | 11 ++++++++++-
 .../src/wallet/Transaction.stories.tsx                    | 15 +++++++++++----
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git 
a/packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx 
b/packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx
index 2f50fda2..ae451dcd 100644
--- a/packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx
+++ b/packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx
@@ -13,7 +13,7 @@
  You should have received a copy of the GNU General Public License along with
  GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
-import { TalerErrorDetails } from "@gnu-taler/taler-util";
+import { TalerErrorCode, TalerErrorDetails } from "@gnu-taler/taler-util";
 import { VNode, h, Fragment } from "preact";
 import { useState } from "preact/hooks";
 import arrowDown from "../../static/img/chevron-down.svg";
@@ -29,7 +29,11 @@ export function ErrorTalerOperation({
 }): VNode | null {
   const { devMode } = useDevContext();
   const [showErrorDetail, setShowErrorDetail] = useState(false);
+  
   if (!title || !error) return null;
+  // const errorCode: number | undefined = (error.details as 
any)?.errorResponse?.code
+  const errorHint: string | undefined = (error.details as 
any)?.errorResponse?.hint
+
   return (
     <ErrorBox style={{ paddingTop: 0, paddingBottom: 0 }}>
       <div>
@@ -49,6 +53,11 @@ export function ErrorTalerOperation({
           <div style={{ padding: 5, textAlign: "left" }}>
             <div>{error.message}</div>
           </div>
+          {errorHint && 
+          <div style={{ padding: 5, textAlign: "left" }}>
+            <div>{errorHint}</div>
+          </div>
+          }
           {devMode && (
             <div style={{ textAlign: "left", overflowX: "auto" }}>
               <pre>{JSON.stringify(error, undefined, 2)}</pre>
diff --git 
a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx 
b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx
index 6f57df31..4e843392 100644
--- a/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/Transaction.stories.tsx
@@ -123,10 +123,17 @@ const exampleData = {
 };
 
 const transactionError = {
-  code: 2000,
-  details: "details",
-  hint: "this is a hint for the error",
-  message: "this is the error message with get from the app",
+  code: 7005,
+  details: {
+    requestUrl: 
"http://merchant-backend.taler:9966/orders/2021.340-02AD5XCC97MQM/pay";,
+    httpStatusCode: 410,
+    errorResponse: {
+      code: 2161,
+      hint: "The payment is too late, the offer has expired."
+    }
+  },
+  hint: "Error: WALLET_UNEXPECTED_REQUEST_ERROR",
+  message: "Unexpected error code in response",
 };
 
 export const Withdraw = createExample(TestedComponent, {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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