-
The App need to create Error boundary component at top of the component tree.
-
Any child under Error boundary component can dispatch custom Error event
-
The custom event is handled by Error boundary component and based on event payload it displays error on different Error component
- Alert
- Toast
- Banner
- Snack bar
- Dialog
Creating and dispatching Error event with payload to show in Toast/Notification component
$emit(
ErrorBoundaryEvent.ERROR_BOUNDARY_EVENT,
getErrorBuilder()
.withTitle(err.CODE)
.withErrorDetails(getErrorFormat(err))
.withNotification(
getNotificationBuilder()
.withType('warning')
.withAutoClose(true)
.withCloseTimeout(notificationCloseTimeout)
.build())
.build())
To enable this module in your application, follow the steps below.
- Add
@genesislcap/foundation-errors
as a dependency in yourpackage.json
file. Whenever you change the dependencies of your project, ensure you run the$ npm run bootstrap
command again. You can find more information in the package.json basics page.
{
...
"dependencies": {
...
"@genesislcap/foundation-errors": "latest"
...
},
...
}
Note: this project provides front-end dependencies and uses licensed components listed in the next section; thus, licenses for those components are required during development. Contact Genesis Global for more details.
Genesis low-code platform