Hookup unhandledrejection and error events even the application is not running under development mode

This commit is contained in:
NI
2019-09-19 15:12:53 +08:00
parent 9804af7219
commit cc4f095995

View File

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