Skip to content

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!

3 participants