mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-09-01 11:39:21 +02:00
web: create error from ErrorEvent if none found
This commit is contained in:
@@ -41,7 +41,9 @@ export default function useDatabase(persistence: "db" | "memory" = "db") {
|
||||
.catch((e) => showBoundary(e));
|
||||
|
||||
function handleError(e: ErrorEvent) {
|
||||
showBoundary(e.error);
|
||||
const error = new Error(e.message);
|
||||
error.stack = `${e.filename}:${e.lineno}:${e.colno}`;
|
||||
showBoundary(e.error || error);
|
||||
}
|
||||
function handleUnhandledRejection(e: PromiseRejectionEvent) {
|
||||
showBoundary(e.reason);
|
||||
|
||||
Reference in New Issue
Block a user