RockefellerArchiveCenter/dimes

Report error in UI when API calls fail

Closed this issue · 4 comments

Is your feature request related to a problem? Please describe.

When calls from DIMES to api.rockarch.org fail or time out, users just see endless loading in DIMES. We've seen from several researchers in the Reading Room (and staff attempting to help them troubleshoot) that it isn't clear to users what the problem is or why the page won't load, leading them to think it may be their own browser's or computer's error.

Describe the solution you'd like

When API calls fail, display an error message alerting the user that there is a problem with the system.

The error message when the Request Broker is unavailable is: "Sorry, our system is unable to process requests right now. We're working to fix this! Please try again later." I'd recommend a similar message appear on the page for failed API calls:
"Sorry, our system is unable to retrieve the information you requested right now. We're working to fix this! Please try again later."

This would appear on every page where a failed API call would prevent the page from loading:

  1. Agent
  2. MyList
  3. Records
  4. Search

Describe alternatives you've considered

Consideration: I'm wondering if stating "We're working to fix this!" would discourage our staff users from reporting the problem?

What if we surface a more specific error message like "The request to https://api.rockarch.org/search?q=chimpanzees failed with the status code 500"? That information isn't particularly useful to an end user but it does tell them that something went wrong, and hints that maybe they should pass along the specifics of that message? I think "our system" is too vague in this context to be meaningful, and doesn't necessarily help us diagnose either.

That makes a lot of sense. How about "The request to https://api.rockarch.org/search?q=chimpanzees failed with the status code 500. To report this problem, send us an email at archive.rockarch.org."

Transient/contextual errors from the request broker trigger a similar situation. For example, consider the case of clicking on "View in Reading Room", but a request to POST https://dimes.rockarch.org/request-broker/process-request/parse fails. React will raise an exception on an uncaught promise for the SavedItem, and the DIMES screen will go white. I see affinity between this experience and this issue, but if you would like a separate issue reported, just let me know and I can do so.

parentRef={item.parent_ref}

Uncaught (in promise) TypeError: e is undefined
    o index.js:49
    Z_ index.js:46
    React 7
    unstable_runWithPriority scheduler.production.min.js:19
    React 5
    t index.js:248
    l runtime.js:63
    _invoke runtime.js:294
    E runtime.js:119
    Babel 6
    n index.js:220
    B_ index.js:220
    B_ index.js:253
    React 2
    unstable_runWithPriority scheduler.production.min.js:19
    React 3
    W scheduler.production.min.js:17
    onmessage scheduler.production.min.js:14
    36813 scheduler.production.min.js:13
    Webpack 10
index.js:49:6

@ctgraham would you be able to check out #537 and see if that fixes this issue with Request Broker calls?