slim icon indicating copy to clipboard operation
slim copied to clipboard

Handle errors globally with Error Middleware and React Error Boundary

Open GitanjaliChhetri opened this issue 1 year ago • 1 comments

Summary of the PR:

  1. Handle all known errors from dicomweb-client, dcmjs, dmv, and the app itself using ErrorMiddleware.js (an extension of pubsub pattern). Errors are now funneled to the onError event. User is notified based on the notification type (configurable, toast and console for now) for each source of error.
  2. A debug info button is added to the header component. It is subscribed to the onError event and keeps a record of all 3 types of error - Server, Data Parsing, and Viewer.
  3. ErrorBoundary.tsx : The React error boundary component is responsible for catching (unexpected) rendering errors and displays a modal window as a fallback component. It is currently wrapped around the App component.

image image image

GitanjaliChhetri avatar Nov 19 '22 05:11 GitanjaliChhetri