Skip to content

Commit

Permalink
impr: make uncaught error notifications important on dev
Browse files Browse the repository at this point in the history
!nuf
  • Loading branch information
Miodec committed Feb 15, 2025
1 parent 535700f commit 31529a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions frontend/src/ts/event-handlers/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ window.onerror = function (message, url, line, column, error): void {
Notifications.add(error?.message ?? "Undefined message", -1, {
customTitle: "DEV: Unhandled error",
duration: 5,
important: true,
});
}
void log("error", {
Expand All @@ -51,6 +52,7 @@ window.onunhandledrejection = function (e): void {
Notifications.add(`${message}`, -1, {
customTitle: "DEV: Unhandled rejection",
duration: 5,
important: true,
});
console.error(e);
}
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/ts/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ function updateKeytips(): void {
if (isDevEnvironment()) {
window.onerror = function (error): void {
if (JSON.stringify(error).includes("x_magnitude")) return;
Notifications.add(JSON.stringify(error), -1);
Notifications.add(JSON.stringify(error), -1, {
important: true,
duration: 5,
});
};
$("header #logo .top").text("localhost");
$("head title").text($("head title").text() + " (localhost)");
Expand Down

0 comments on commit 31529a3

Please sign in to comment.