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

chore: imporve error logs in server/cluster/cluser.go #20710

Open
SuminSSon opened this issue Nov 8, 2024 · 0 comments
Open

chore: imporve error logs in server/cluster/cluser.go #20710

SuminSSon opened this issue Nov 8, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@SuminSSon
Copy link
Contributor

Summary

There are numerous instances in the source code where errors are returned without context using fmt.Errorf(). This makes debugging more challenging.

Motivation

Providing context in error messages helps developers understand where and why an error occurred, making it easier to debug issues.

Proposal

Identify locations in the code where errors are returned without wrapping them and add appropriate context.

Example:

// Old code
err := c.cache.GetItem()
if err != nil {
    return err
}

// New code
err := c.cache.GetItem()
if err != nil {
    return fmt.Errorf("error getting item from the cache: %w", err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant