diff options
author | Florian Dold <florian@dold.me> | 2022-03-22 21:16:38 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-03-22 21:16:38 +0100 |
commit | 5d23eb36354d07508a015531f298b3e261bbafce (patch) | |
tree | fae0d2599c94d88c9264bb63a301adb1706824c1 /packages/taler-wallet-webextension/src/cta/Deposit.tsx | |
parent | f8d12f7b0d4af1b1769b89e80c87f9c169678564 (diff) | |
download | wallet-core-5d23eb36354d07508a015531f298b3e261bbafce.tar.xz |
wallet: improve error handling and error codes
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Deposit.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Deposit.tsx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Deposit.tsx b/packages/taler-wallet-webextension/src/cta/Deposit.tsx index ac6c1fd6d..933195a9e 100644 --- a/packages/taler-wallet-webextension/src/cta/Deposit.tsx +++ b/packages/taler-wallet-webextension/src/cta/Deposit.tsx @@ -35,7 +35,7 @@ import { PreparePayResultType, Translate, } from "@gnu-taler/taler-util"; -import { OperationFailedError } from "@gnu-taler/taler-wallet-core"; +import { TalerError } from "@gnu-taler/taler-wallet-core"; import { Fragment, h, VNode } from "preact"; import { useEffect, useState } from "preact/hooks"; import { ErrorTalerOperation } from "../components/ErrorTalerOperation"; @@ -64,9 +64,9 @@ export function DepositPage({ talerPayUri, goBack }: Props): VNode { const [payResult, setPayResult] = useState<ConfirmPayResult | undefined>( undefined, ); - const [payErrMsg, setPayErrMsg] = useState< - OperationFailedError | string | undefined - >(undefined); + const [payErrMsg, setPayErrMsg] = useState<TalerError | string | undefined>( + undefined, + ); const balance = useAsyncAsHook(wxApi.getBalance, [ NotificationType.CoinWithdrawn, @@ -97,7 +97,7 @@ export function DepositPage({ talerPayUri, goBack }: Props): VNode { setPayStatus(p); } catch (e) { console.log("Got error while trying to pay", e); - if (e instanceof OperationFailedError) { + if (e instanceof TalerError) { setPayErrMsg(e); } if (e instanceof Error) { @@ -117,7 +117,7 @@ export function DepositPage({ talerPayUri, goBack }: Props): VNode { } if (!payStatus) { - if (payErrMsg instanceof OperationFailedError) { + if (payErrMsg instanceof TalerError) { return ( <WalletAction> <LogoHeader /> @@ -131,7 +131,7 @@ export function DepositPage({ talerPayUri, goBack }: Props): VNode { Could not get the payment information for this order </i18n.Translate> } - error={payErrMsg?.operationError} + error={payErrMsg?.errorDetail} /> </section> </WalletAction> |