-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
When using <rv-reveal-view>
, if the dashboard doesn't exist or the request fails for any other reason there's no error handler. The unhandled error ends up in the console and the dashboard appears in "New" state.
e.g.
https://codepen.io/pmoleri/pen/EaVOKLo
I'd like to be able to "handle the Error".
It could a callback like in React:
optional onError? callback.
Or perhaps more web components oriented event dispatch:
try {
// Code that might throw
} catch (error) {
const customEvent = new CustomEvent('componentError', {
bubbles: true,
composed: true,
cancelable: true,
detail: { originalError: error }
});
const unhandled = this.dispatchEvent(customEvent);
if (unhandled) {
console.error('Unhandled error in custom component:', error);
}
}
which can be handled by event.preventDefault();
.
Workaround:
Load the dashboard myself and pass it to the rv-reveal-view:
$.ig.RevealUtility.loadDashboard(name)
.then(dashboard => {
this.rvRevealView.dashboard = dashboard;
})
.catch(err => {
this.showError(err);
});
Metadata
Metadata
Assignees
Labels
No labels