I noticed that in Viewer.jsx the source error is displayed only when it is not an array:
} else if (!Array.isArray(sourceErrors) && sourceErrors) {
return (
<div className="alert alert-danger" role="alert">
{sourceErrors.message}
</div>
);
}
This implementation allows us to see the error message No source provided, but it does not account for server errors such as 404 Not Found, 401 Unauthorized, and 403 Forbidden. Indeed, in these cases, the sourceErrors variable is an array containing a single element.
I found that I can view these errors by modifying hooks.js to replace setErrors(errors) with:
setErrors(errors.length === 1 ? errors[0] : errors);
With this change, the error messages are displayed as follows:
- 404:
Node not found: v2 group
- 401:
Unexpected response status 401 Unauthorized
Changing the setErrors call is a quick fix, but I wonder if you are considering a solution that would allow to support the multiple error messages case.
I noticed that in
Viewer.jsxthe source error is displayed only when it is not an array:This implementation allows us to see the error message
No source provided, but it does not account for server errors such as 404 Not Found, 401 Unauthorized, and 403 Forbidden. Indeed, in these cases, thesourceErrorsvariable is an array containing a single element.I found that I can view these errors by modifying
hooks.jsto replacesetErrors(errors)with:With this change, the error messages are displayed as follows:
Node not found: v2 groupUnexpected response status 401 UnauthorizedChanging the
setErrorscall is a quick fix, but I wonder if you are considering a solution that would allow to support the multiple error messages case.