mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-10 06:01:28 +08:00
refactor: add error logging to analytics
This commit is contained in:
parent
e0bb96e008
commit
6667fe53ba
1 changed files with 13 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ import { Workbox } from "workbox-window";
|
|||
import * as FunboxList from "./test/funbox/funbox-list";
|
||||
//@ts-ignore
|
||||
import Konami from "konami";
|
||||
import { log } from "./controllers/analytics-controller";
|
||||
|
||||
if (Misc.isLocalhost()) {
|
||||
$("footer .currentVersion .text").text("localhost");
|
||||
|
|
@ -141,3 +142,15 @@ if ("serviceWorker" in navigator) {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
window.onerror = function (message, url, line, column, error): void {
|
||||
log("error", {
|
||||
error: error?.stack ?? "",
|
||||
});
|
||||
};
|
||||
|
||||
window.onunhandledrejection = function (e): void {
|
||||
log("error", {
|
||||
error: e.reason.stack ?? "",
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue