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,6 +294,7 @@ 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) { window.addEventListener("unhandledrejection", function(e) {
console.error("Error:", e); console.error("Error:", e);
@@ -302,7 +303,6 @@ function initializeClient() {
window.addEventListener("error", function(e) { window.addEventListener("error", function(e) {
console.error("Error:", e); console.error("Error:", e);
}); });
}
landingRoot.parentNode.removeChild(landingRoot); landingRoot.parentNode.removeChild(landingRoot);