Skip to content

Commit 31529a3

Browse files
committed
impr: make uncaught error notifications important on dev
!nuf
1 parent 535700f commit 31529a3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

frontend/src/ts/event-handlers/global.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ window.onerror = function (message, url, line, column, error): void {
3737
Notifications.add(error?.message ?? "Undefined message", -1, {
3838
customTitle: "DEV: Unhandled error",
3939
duration: 5,
40+
important: true,
4041
});
4142
}
4243
void log("error", {
@@ -51,6 +52,7 @@ window.onunhandledrejection = function (e): void {
5152
Notifications.add(`${message}`, -1, {
5253
customTitle: "DEV: Unhandled rejection",
5354
duration: 5,
55+
important: true,
5456
});
5557
console.error(e);
5658
}

frontend/src/ts/ui.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ function updateKeytips(): void {
5858
if (isDevEnvironment()) {
5959
window.onerror = function (error): void {
6060
if (JSON.stringify(error).includes("x_magnitude")) return;
61-
Notifications.add(JSON.stringify(error), -1);
61+
Notifications.add(JSON.stringify(error), -1, {
62+
important: true,
63+
duration: 5,
64+
});
6265
};
6366
$("header #logo .top").text("localhost");
6467
$("head title").text($("head title").text() + " (localhost)");

0 commit comments

Comments
 (0)