Browse Source

feat: Prints an error log for errors in child components render methods.

master
Дамян Минков 3 years ago
parent
commit
5c299bcd46
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      react/features/base/app/components/BaseApp.js

+ 12
- 0
react/features/base/app/components/BaseApp.js View File

100
         this.state.store.dispatch(appWillUnmount(this));
100
         this.state.store.dispatch(appWillUnmount(this));
101
     }
101
     }
102
 
102
 
103
+    /**
104
+     * Logs for errors that were not caught.
105
+     *
106
+     * @param {Error} error - The error that was thrown.
107
+     * @param {Object} info - Info about the error(stack trace);.
108
+     *
109
+     * @returns {void}
110
+     */
111
+    componentDidCatch(error: Error, info: Object) {
112
+        logger.error(error, info);
113
+    }
114
+
103
     /**
115
     /**
104
      * Delays this {@code BaseApp}'s startup until the {@code Storage}
116
      * Delays this {@code BaseApp}'s startup until the {@code Storage}
105
      * implementation of {@code localStorage} initializes. While the
117
      * implementation of {@code localStorage} initializes. While the

Loading…
Cancel
Save