Skip to content

[sled agent] Overhaul error handling to be more informative #967

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

Merged
merged 62 commits into from
May 5, 2022

Conversation

smklein
Copy link
Collaborator

@smklein smklein commented Apr 25, 2022

Fixes #966

General principles:

  • Errors should be "self-contained" as much as possible - if a function returns an error, the error alone should provide enough context to identify "where and why the error happened".
  • For externally-defined errors, this often means wrapping the error with a string message, name, or other identifying information
  • usage of error(transparent) and thiserror's #[from] has been reduced significantly. These attributes are permitted on "high-level" aggregation services, but only when operating on errors that are sufficiently self-describing.

@smklein smklein added Sled Agent Related to the Per-Sled Configuration and Management cleanup Code cleanliness labels Apr 25, 2022
Copy link
Contributor

@jgallagher jgallagher left a comment

Choose a reason for hiding this comment

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

Thanks for this! I think this a fantastic improvement.

Base automatically changed from internal-dns-assigned-ips to main May 4, 2022 18:35
@smklein smklein merged commit 2893c18 into main May 5, 2022
@smklein smklein deleted the better-errors branch May 5, 2022 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code cleanliness Sled Agent Related to the Per-Sled Configuration and Management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[sled-agent] Improve Error Messages!
2 participants