Skip to content
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

Cleanup redis cluster error handling #1109

Merged
merged 3 commits into from Apr 3, 2023

Conversation

rukai
Copy link
Member

@rukai rukai commented Mar 30, 2023

When writing our error handling we've settled on the approach of:

  • use anyhow for everything, making strong use of its .context() functionality to report chains of errors
  • when we need to report errors in a way that allows the caller to decide what to do we use a custom enum instead, possibly containing an Other(anyhow::Error) variant.

However this redis code was written a long time ago and doesnt follow that, so I am updating it to do so in this PR.

TransformError::IO etc are not used for any logic so I have instead combined them into TransformError::Other

Same with ConnectionError I created a transparent ConnectionError::Other variant for them

There was a duplicate tracing::warn in many cases so I removed it and let the caller deal with warning when it needs to.

@rukai rukai force-pushed the cleanup_redis_cluster_error_handling branch from babee82 to 8809ea7 Compare March 30, 2023 22:35
@rukai rukai force-pushed the cleanup_redis_cluster_error_handling branch from 8809ea7 to dfbf6d8 Compare March 30, 2023 23:00
@rukai rukai enabled auto-merge (squash) April 3, 2023 03:56
@rukai rukai merged commit 7e1206d into shotover:main Apr 3, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants