NYPL-Simplified / webpub-viewer

8 stars 4 forks source link

Errors don't show up by default #174

Closed hokei closed 3 years ago

hokei commented 3 years ago

The webpub viewer used to catch and display an error whenever one would show up, even when it got resolved later.
It will now show the loading page

When used in Circulation-patron-web, there are two loading states:
cpw loads webpub-viewer webpub-viewer loads a book

This only addresses the second loading state. It might be useful to put a circulation-patron-web loading screen when it is loading the viewer (in the future)

hokei commented 3 years ago

I think the best UX and DX for errors would be if the component is wrapped in an ErrorBoundary in CPW, which catches any errors thrown inside it and displays a fallback UI.

Ideally this package should stand alone, so it should handle its own errors ... it would be bad to expect that whoever's consuming it has to do something specific to make it work properly. I'm curious though, why would this be better than figuring out what each method should do and what kinds of errors each should throw, and handling them on a case-by-case basis?

Added changelog ... it looks like package.json and package-lock.json is the same ... but I'm not exactly sure we're looking at the same thing? Let me know if it still looks strange