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

Errors should be wrapped when possible #321

Closed
ccoVeille opened this issue Dec 29, 2024 · 4 comments
Closed

Errors should be wrapped when possible #321

ccoVeille opened this issue Dec 29, 2024 · 4 comments
Labels
good first issue Good for newcomers maintainance / not prio Non user-critical change that improves the codebase

Comments

@ccoVeille
Copy link
Collaborator

-		return errors.New("error creating file")
+		return fmt.Errorf("error creating file: %w", err)

Originally posted by @ccoVeille in #302 (comment)

@EwenQuim EwenQuim added the good first issue Good for newcomers label Dec 31, 2024
@EwenQuim
Copy link
Member

It's in the cli, isn't it? Good idea

@ccoVeille
Copy link
Collaborator Author

It was at least in

func (e *Engine) saveOpenAPIToFile(jsonSpecLocalPath string, jsonSpec []byte) error {

The errors are replaced by new one instead of wrapping them

@EwenQuim
Copy link
Member

Ah exactly!

Minor as it doesn't impact runtime requests, but should definitely be handled! I tag it as low prio

@EwenQuim EwenQuim added the maintainance / not prio Non user-critical change that improves the codebase label Dec 31, 2024
@dylanhitt
Copy link
Collaborator

Closed with #331. Greping through the code base there currently doesn't seem to be any other occurrences of this pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers maintainance / not prio Non user-critical change that improves the codebase
Projects
None yet
Development

No branches or pull requests

3 participants