Skip to content

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

Merged
smklein merged 62 commits into
mainfrom
better-errors
May 5, 2022
Merged

[sled agent] Overhaul error handling to be more informative#967
smklein merged 62 commits into
mainfrom
better-errors

Conversation

@smklein

@smklein smklein commented Apr 25, 2022

Copy link
Copy Markdown
Collaborator

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.

Comment thread sled-agent/src/bootstrap/agent.rs
Comment thread sled-agent/src/illumos/zone.rs
@smklein smklein added Sled Agent Related to the Per-Sled Configuration and Management cleanup Code cleanliness labels Apr 25, 2022

@jgallagher jgallagher left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread sled-agent/src/bootstrap/agent.rs Outdated
Comment thread sled-agent/src/bootstrap/agent.rs Outdated
Comment thread sled-agent/src/illumos/dladm.rs Outdated
Comment thread sled-agent/src/illumos/mod.rs
Comment thread sled-agent/src/illumos/zfs.rs Outdated
Comment thread sled-agent/src/illumos/zone.rs
Comment thread sled-agent/src/illumos/zpool.rs Outdated
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