Merge pull request #873 from vector-im/madlittlemods/log-errors-to-console

Log errors when mounting views to the console for easier reference
This commit is contained in:
R Midhun Suresh 2022-10-11 11:40:35 +05:30 committed by GitHub
commit 07823c2cd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,9 @@ export function mountView(view: IView, mountArgs?: IMountArgs): ViewNode {
try {
node = view.mount(mountArgs);
} catch (err) {
// Log it to the console so it's easy to reference
console.error(err);
// Then render our error boundary to the DOM
node = errorToDOM(err);
}
return node;