diff options
author | Sebastian <sebasjm@gmail.com> | 2023-01-09 20:20:09 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-01-09 20:20:09 -0300 |
commit | 4a781bd0dd8828ce152f6ab2c3f1bbd6b5e826f7 (patch) | |
tree | 5c16976f99eb973ff62d78ed64107ca01df57b99 /packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts | |
parent | 8a70edb2f8e235c3462127b0aa4e1b65aa1aee0b (diff) |
fix #7153: more error handling
if handler do not trap error then fail at compile time,
all safe handlers push alert on error
errors are typed so they render good information
Diffstat (limited to 'packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts b/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts index 978ea90e1..cf9409bad 100644 --- a/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts +++ b/packages/taler-wallet-webextension/src/hooks/useAsyncAsHook.ts @@ -16,7 +16,7 @@ import { TalerErrorDetail } from "@gnu-taler/taler-util"; import { TalerError } from "@gnu-taler/taler-wallet-core"; import { useEffect, useMemo, useState } from "preact/hooks"; -import { WalletError } from "../wxApi.js"; +import { BackgroundError } from "../wxApi.js"; export interface HookOk<T> { hasError: false; @@ -74,12 +74,12 @@ export function useAsyncAsHook<T>( message: e.message, details: e.errorDetail, }); - } else if (e instanceof WalletError) { + } else if (e instanceof BackgroundError) { setHookResponse({ hasError: true, type: "taler", message: e.message, - details: e.errorDetail.errorDetail, + details: e.errorDetail, }); } else if (e instanceof Error) { setHookResponse({ |