aboutsummaryrefslogtreecommitdiff
path: root/packages/web-util/src
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-09-25 14:49:47 -0300
committerSebastian <sebasjm@gmail.com>2023-09-25 14:50:46 -0300
commitea0738ccd585445d7e2080d9009025dde9cf22c5 (patch)
tree1e89ceadefb2b66d8c762358c794f070c2f10dcd /packages/web-util/src
parent820f953b96b2b2852c32dc16a2fa920c6c717788 (diff)
downloadwallet-core-ea0738ccd585445d7e2080d9009025dde9cf22c5.tar.xz
better /config error
Diffstat (limited to 'packages/web-util/src')
-rw-r--r--packages/web-util/src/hooks/index.ts1
-rw-r--r--packages/web-util/src/hooks/useNotifications.ts11
2 files changed, 12 insertions, 0 deletions
diff --git a/packages/web-util/src/hooks/index.ts b/packages/web-util/src/hooks/index.ts
index c29de9023..cc3267dbd 100644
--- a/packages/web-util/src/hooks/index.ts
+++ b/packages/web-util/src/hooks/index.ts
@@ -4,6 +4,7 @@ export { useMemoryStorage } from "./useMemoryStorage.js";
export {
useNotifications,
notifyError,
+ notifyException,
notifyInfo,
notify,
ErrorNotification,
diff --git a/packages/web-util/src/hooks/useNotifications.ts b/packages/web-util/src/hooks/useNotifications.ts
index 2f9df24f9..792095b06 100644
--- a/packages/web-util/src/hooks/useNotifications.ts
+++ b/packages/web-util/src/hooks/useNotifications.ts
@@ -36,6 +36,17 @@ export function notifyError(
debug,
});
}
+export function notifyException(
+ title: TranslatedString,
+ ex: Error,
+) {
+ notify({
+ type: "error" as const,
+ title,
+ description: ex.message as TranslatedString,
+ debug: ex.stack,
+ });
+}
export function notifyInfo(title: TranslatedString) {
notify({
type: "info" as const,