From 5c299bcd46a4dddba0f785721a449f4920a12ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=8F=D0=BD=20=D0=9C=D0=B8=D0=BD=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Tue, 31 Aug 2021 12:00:37 -0500 Subject: [PATCH] feat: Prints an error log for errors in child components render methods. --- react/features/base/app/components/BaseApp.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/react/features/base/app/components/BaseApp.js b/react/features/base/app/components/BaseApp.js index 5db3384a6..6a567be10 100644 --- a/react/features/base/app/components/BaseApp.js +++ b/react/features/base/app/components/BaseApp.js @@ -100,6 +100,18 @@ export default class BaseApp extends Component<*, State> { this.state.store.dispatch(appWillUnmount(this)); } + /** + * Logs for errors that were not caught. + * + * @param {Error} error - The error that was thrown. + * @param {Object} info - Info about the error(stack trace);. + * + * @returns {void} + */ + componentDidCatch(error: Error, info: Object) { + logger.error(error, info); + } + /** * Delays this {@code BaseApp}'s startup until the {@code Storage} * implementation of {@code localStorage} initializes. While the