-
Notifications
You must be signed in to change notification settings - Fork 270
DOC-5880 DOC-5881 DOC-5882 DOC-5883 DOC-5885 DOC-5886 Error checking pages #2349
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few comments regarding link weirdness. Otherwise, LGTM.
| ### Pattern 1: Fail fast | ||
|
|
||
| Catch specific exceptions that represent unrecoverable errors and re-throw them (see | ||
| [Pattern 1: Fail fast]({{< relref "/develop/clients/error-handling#pattern-1-fail-fast" >}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why, but this anchor goes to a location well above the actually section.
| ### Pattern 2: Graceful degradation | ||
|
|
||
| Catch specific errors and fall back to an alternative, where possible (see | ||
| [Pattern 2: Graceful degradation]({{< relref "/develop/clients/error-handling#pattern-2-graceful-degradation" >}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one too. Maybe the diagrams are throwing something off?
| ### Pattern 3: Retry with backoff | ||
|
|
||
| Retry on temporary errors such as timeouts (see | ||
| [Pattern 3: Retry with backoff]({{< relref "/develop/clients/error-handling#pattern-3-retry-with-backoff" >}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
| ### Pattern 4: Log and continue | ||
|
|
||
| Log non-critical errors and continue (see | ||
| [Pattern 4: Log and continue]({{< relref "/develop/clients/error-handling#pattern-4-log-and-continue" >}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
| C -->|Timeout| D(["Retry with<br/>exponential backoff"]) | ||
| C -->|Auth failure| E(["Check credentials<br/>and fail"]) | ||
| C -->|Network error| F(["Fallback to<br/>alternative data source"]) | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the diagrams!
| | `redis.ConnectionError` | Network or connection issues | Yes | Retry with backoff or fall back to alternative | | ||
| | `redis.TimeoutError` | Operation exceeded timeout | Yes | Retry with backoff | | ||
| | `redis.ResponseError` | Invalid command or Redis error response | No | Fix the command or arguments | | ||
| | `redis.DataError` | Data serialization/deserialization issues | Sometimes | Log, invalidate cache, fetch fresh data | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On other pages, you used icons to represent Yes and No. Could you do that here as well?
|
A particular concern is that the overview page contains examples based on Python usage. It seems like Python is close enough to "pseudocode" for this to be a reasonable approach, but let me know if there's a better solution. I think this is okay. It seems that Python is very widely used, so most developers would be able to read it. |
This mainly comes from an investigation into what would help AI generate better code (but we also got at least one human request for more info about error checking). As a bonus feature (again recommended by Augment/ChatGPT), I've added support for Mermaid diagrams to the doc build.
Any feedback about the error categories, examples, Mermaid support, etc, is welcome. A particular concern is that the overview page contains examples based on Python usage. It seems like Python is close enough to "pseudocode" for this to be a reasonable approach, but let me know if there's a better solution.