Add error handlers to catch uncaugth errors

This commit is contained in:
NI
2019-09-09 22:15:36 +08:00
parent 588118cf3c
commit 0d2af658ac

View File

@@ -284,6 +284,18 @@ function initializeClient() {
return;
}
if (process.env.NODE_ENV === "development") {
console.log("Currently in Development environment");
window.addEventListener("unhandledrejection", function(e) {
console.error("Error:", e);
});
window.addEventListener("error", function(e) {
console.error("Error:", e);
});
}
landingRoot.parentNode.removeChild(landingRoot);
let normalRoot = document.createElement("div");