Skip to content

Commit

Permalink
Show error in console
Browse files Browse the repository at this point in the history
  • Loading branch information
roginvs committed Nov 17, 2024
1 parent 57ae668 commit 842a325
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions os/web/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ import { registerServiceWorker } from "./service_worker_manager.mjs";

window.addEventListener("error", (err) => {
console.info("error", err);
console.info(
`Error is: ${err.error?.name}: ${err.error?.message} ${err.error?.stack}`
);
setErrorState(err.error);
});
window.addEventListener("unhandledrejection", (err) => {
console.info("unhandledrejection", err);
console.info(
`reason ${err.reason?.name}: ${err.reason?.message} ${err.reason?.stack}`
`Reason is: ${err.reason?.name}: ${err.reason?.message} ${err.reason?.stack}`
);
//console.info(`error ${err.promise?.name}: ${err.error?.message} ${err.error?.stack}`);
});

initializeGlobalModuleObject();
Expand Down

0 comments on commit 842a325

Please sign in to comment.