-
Notifications
You must be signed in to change notification settings - Fork 885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Proposal] Error classes, components, and codes #1625
Comments
Note: some back-end timeouts (long query, etc.) manifest to the end user as a 403. This is confusing and makes the product harder to support and troubleshoot. As part of this work we should adhere to HTTP status code standards. |
This problem comes up way too often in our managed service where users are confused, then the Engineer debugging a problem gets confused, and we get back to this again and again. Would someone care to contribute a fix for just the timeout leading to a 403 part of the problem? cc: @seanneumann I opened #2320 for that specific issue. |
As I am working through developing error handling guidance through the lens of the design system, I am wondering if we can formalize some next steps here. From there I imagine we might :
Does this sound actionable? Is there a reasonable way to get a dump of the handled errors, and potentially identify which errors are not yet handled but we would like to get these accounted for? |
@KrooshalUX I like this idea, although I think it's a significant amount of work. Some errors are relatively easy to find and extract from the code, but others that dynamically bubble through multiple components will be harder to track down. For point 1, how we present them in the UI, an audit may be the first step, but some automated test tooling may have even broader long-term impact. Do you see this audit effort as part of OUI compliance, or as a follow-up to the current wave of work we're doing in #4111? |
Another error UI improvement I was thinking about - when an action is not permitted because of some user-controlable setting, ideally the error message would deep link to the appropriate advanced setting: see #3961 (comment) |
@joshuarrrr Great question - I consider this part of the Design System compliance (establishing the patterns), not quite OUI compliance (using components to implement the patterns). This would also be an effort across OSD & all plug-in features to do the audit. If there is any way we can start with the base of OSD, that would be a great first step in helping the Design System establish standards for these error handling patterns. |
Possibly, there are cases where users wont have control over advanced setting, so sending them there isnt always useful / could be more frustrating. This would fall in the bucket of establishing a pattern of handling permission errors. |
Problem Statements
Solution
Problems 1 and 2 should be solved with a component library for errors, problem 3 is solved with error codes. Error codes are most useful if they're presented in a consistent way, so codes require 1 and 2 to be solved.
Error Classes
I want to be able to, at any point in the stack, receive/create/pass objects that represent errors I can work with predictably.
Must haves:
Nice to haves:
(error: NewOSErrorClass | any) => isErrorType(error, MySpecialError) ? doThing() : doOtherThing()
If we could do something with TS discriminated unions that would be sick
Error Components
I want to have a component library that displays errors. EUI already has some "error-y" components and treatments, but I want something dead simple--a set of maybe 4-5 components that will take an error (or any value) and render it.
For example, these components might be:
These components would do the smart thing when stack traces, error codes, messages, debug information, etc. are or are not available.
The ideal API would look something like this:
Error Codes
Error codes should be:
Suggested Implementation
Out of scope: Error Handling
It'd be nice to work on error handling, but for this I'm only looking at being able to identify and display errors.
Additional context
React does error codes very well, where codes link back to the react documentation. I'd like if we can do something like that eventually, but for now the low-hanging fruit is google-ability and display-ability.
The text was updated successfully, but these errors were encountered: