diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx b/packages/taler-wallet-webextension/src/components/ErrorTalerOperation.tsx index 2f50fda2f..ae451dcd8 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> |