Errors

Automatic reporting

Any error that occurs during component rendering is logged to console.error(). Many frontend APM tools such as Datadog and Rollbar will automatically pick up on this, and log accordingly.

Manual reporting

If you’d like to handle errors yourself, reporting can be handled safely via the manifold-error custom event. This same custom event fires for all components:

document.addEventListener('manifold-error', ({ detail }) => {
  console.log(detail);
  // {
  //   component: 'ManifoldPlanSelector',
  //   error: 'Something went wrong',
  // }

  // Report error message somewhere, or show something to the user…
});

User display

We’ll automatically display the same error message to the user via a toast if a component fails to render.