Skip to content

fix: improve sata controller error handling#495

Merged
lbajolet-hashicorp merged 1 commit intomainfrom
fix/sata-controller-error-handling
Dec 6, 2024
Merged

fix: improve sata controller error handling#495
lbajolet-hashicorp merged 1 commit intomainfrom
fix/sata-controller-error-handling

Conversation

@tenthirtyam
Copy link
Copy Markdown
Collaborator

  • Utilize errors.Is for accurate error comparison when checking for ErrNoSataController, allowing for correct handling of wrapped errors.
  • Implement error wrapping with %w in fmt.Errorf to preserve underlying error information.
  • Add handling for unexpected error conditions from FindSATAController to ensure robustness.

@tenthirtyam tenthirtyam added the technical-debt Technical Debt label Dec 3, 2024
@tenthirtyam tenthirtyam added this to the v1.5.0 milestone Dec 3, 2024
@tenthirtyam tenthirtyam self-assigned this Dec 3, 2024
@tenthirtyam tenthirtyam requested a review from a team as a code owner December 3, 2024 02:30
@tenthirtyam tenthirtyam force-pushed the fix/sata-controller-error-handling branch from f12204c to 612627b Compare December 3, 2024 02:38
Copy link
Copy Markdown
Contributor

@lbajolet-hashicorp lbajolet-hashicorp 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 the PR @tenthirtyam,

I've left one tiny nitpick on the type check, but besides that, LGTM!

Pre-approving this one

@tenthirtyam tenthirtyam force-pushed the fix/sata-controller-error-handling branch 2 times, most recently from 9e0a0d3 to b0e4ad9 Compare December 5, 2024 21:25
@tenthirtyam tenthirtyam force-pushed the fix/sata-controller-error-handling branch from b0e4ad9 to e23925f Compare December 5, 2024 21:33
- Utilize `errors.Is` for accurate error comparison when checking for `ErrNoSataController`, allowing for correct handling of wrapped errors.
- Implement error wrapping with `%w` in `fmt.Errorf` to preserve underlying error information.
- Add handling for unexpected error conditions from `FindSATAController` to ensure robustness.

Signed-off-by: Ryan Johnson <ryan@tenthirtyam.org>
@tenthirtyam tenthirtyam force-pushed the fix/sata-controller-error-handling branch from e23925f to bb56e2f Compare December 5, 2024 21:34
Copy link
Copy Markdown
Contributor

@lbajolet-hashicorp lbajolet-hashicorp 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 the reroll @tenthirtyam!

LGTM at first glance, will merge if/when CI goes green :)

@lbajolet-hashicorp lbajolet-hashicorp merged commit 05133be into main Dec 6, 2024
@lbajolet-hashicorp lbajolet-hashicorp deleted the fix/sata-controller-error-handling branch December 6, 2024 01:19
@github-actions
Copy link
Copy Markdown

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

technical-debt Technical Debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants