mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-22 10:11:39 +01:00
Log errors when mounting views to the console for easier reference
From the console, I can click the source references in the stack trace to jump to the spot in the code where things are going wrong. It also helps with the problem of the error not having enough space to be read in some components. Split off from https://github.com/vector-im/hydrogen-web/pull/653
This commit is contained in:
parent
5f9cfffa3b
commit
8f414f4cf4
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user