Skip to content

Conversation

@andy-stark-redis
Copy link
Contributor

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.

@andy-stark-redis andy-stark-redis requested a review from a team November 5, 2025 10:56
@andy-stark-redis andy-stark-redis self-assigned this Nov 5, 2025
@andy-stark-redis andy-stark-redis added the clients Client library docs label Nov 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

DOC-5881

Copy link
Collaborator

@dwdougherty dwdougherty left a 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" >}})
Copy link
Collaborator

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" >}})
Copy link
Collaborator

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" >}})
Copy link
Collaborator

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" >}})
Copy link
Collaborator

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"])
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the diagrams!

Comment on lines +43 to +46
| `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 |
Copy link
Collaborator

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?

@dwdougherty
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients Client library docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants