@genesislcap/foundation-errors
TypeScript icon, indicating that this package has built-in type declarations

14.181.1 • Public • Published

Genesis Foundation UI Error Utils

lerna TypeScript

Usage

  • 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

Current Implementation support following Error Components

  • Alert
  • Toast
  • Banner
  • Snack bar
  • Dialog

Creating and dispatching Error Events

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())

Installation

To enable this module in your application, follow the steps below.

  1. Add @genesislcap/foundation-errors as a dependency in your package.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"
    ...
  },
  ...
}

License

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.

Licensed components

Genesis low-code platform

Readme

Keywords

none

Package Sidebar

Install

npm i @genesislcap/foundation-errors

Weekly Downloads

3,856

Version

14.181.1

License

SEE LICENSE IN license.txt

Unpacked Size

212 kB

Total Files

136

Last publish

Collaborators

  • genesisnpm