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

feat: improve error handling #238

Merged
merged 1 commit into from
Oct 5, 2021
Merged

feat: improve error handling #238

merged 1 commit into from
Oct 5, 2021

Conversation

scortier
Copy link
Member

No description provided.

@scortier scortier self-assigned this Sep 27, 2021
@scortier scortier added the enhancement New feature or request label Sep 27, 2021
Copy link
Contributor

@StewartJingga StewartJingga left a comment

Choose a reason for hiding this comment

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

Love the error wrapping but needs some changes on these two things:

  1. Use Wrap instead of Wrapf if there is no string formatting.
  2. For case where return value is already defined you can wrap error like below
if err != nil {
    err = errors.Wrap(err, "wrapping error")
    return
}

agent/stream.go Outdated Show resolved Hide resolved
generator/recipe.go Outdated Show resolved Hide resolved
metrics/statsd.go Outdated Show resolved Hide resolved
@scortier scortier force-pushed the format-errors branch 3 times, most recently from 94a212d to 886318f Compare October 4, 2021 04:59
@scortier scortier requested a review from StewartJingga October 4, 2021 05:01
@scortier scortier marked this pull request as draft October 4, 2021 05:38
@scortier scortier marked this pull request as ready for review October 4, 2021 05:46
agent/agent.go Outdated Show resolved Hide resolved
Copy link
Contributor

@StewartJingga StewartJingga left a comment

Choose a reason for hiding this comment

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

LGTM

@StewartJingga StewartJingga merged commit b0fb0ab into main Oct 5, 2021
@StewartJingga StewartJingga deleted the format-errors branch October 5, 2021 02:26
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

Successfully merging this pull request may close these issues.

2 participants