ImagingDataCommons / slim

Interoperable web-based slide microscopy viewer and annotation tool
https://imagingdatacommons.github.io/slim/
Apache License 2.0
111 stars 36 forks source link

Handle errors globally with Error Middleware and React Error Boundary #134

Closed GitanjaliChhetri closed 1 year ago

GitanjaliChhetri commented 1 year ago

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 commented 1 year ago

@hackermd I am unable to add you as one of the reviewers. Please know this PR is ready for your review. Thanks!

GitanjaliChhetri commented 1 year ago

@hackermd I have addressed the requested changes. Please let me know if this can be merged? Thank you.

fedorov commented 1 year ago

@hackermd if you could let us know when you might have time to look into this, it would be helpful!

igoroctaviano commented 1 year ago

@hackermd comments addressed. Can you please re-review? also, looks like the deploy gh-pages are not working. I think its because of action permissions. https://stackoverflow.com/questions/72851548/permission-denied-to-github-actionsbot

hackermd commented 1 year ago

looks like the deploy gh-pages are not working. I think its because of action permissions. https://stackoverflow.com/questions/72851548/permission-denied-to-github-actionsbot

Not sure why this is happening. The settings are correct and it should work. Maybe a quirk related to the moving of the repository to the ImagingDataCommons organization. Could this be an issue with a global org-wide setting?