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

Use thiserror for better error handling #6434

Merged
merged 6 commits into from May 23, 2024

Conversation

SamrutGadde
Copy link
Contributor

Apologies for the delay, but I've made the suggested changes as mentioned in a previous pull request (See #6376).

I've added just a few of the commits here to make it easier for review, let me know if you see any changes need to be made.

See #1910

@SamrutGadde SamrutGadde requested a review from a team as a code owner May 2, 2024 00:26
@rbradford
Copy link
Member

When you fix the build issue please make sure you squash them into the appropriate commits e.g. you can use git autofixup to do this followed by git rebase -i main --autosquash

@rbradford
Copy link
Member

Please setup the git hooks as described in the CONTRIBUTING.md file.

@SamrutGadde
Copy link
Contributor Author

For some reason the hook didn't catch that error, had to run the same command as in the test to check. It's fixed now.

Socket(std::io::Error),
#[error("Error writing to or reading from HTTP socket: {0}")]
Copy link
Member

Choose a reason for hiding this comment

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

I know you copied from the Display implementation but this error is about sending file descriptors. Please fix as a separate commit.

@rbradford rbradford requested a review from likebreath May 3, 2024 20:54
@rbradford
Copy link
Member

I think this is lgtm - @likebreath ?

@SamrutGadde SamrutGadde force-pushed the use-thiserror branch 2 times, most recently from d092606 to 52b66de Compare May 5, 2024 20:39
@SamrutGadde
Copy link
Contributor Author

apologies, added an accidental commit.

Copy link
Member

@likebreath likebreath left a comment

Choose a reason for hiding this comment

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

I had a quick pass and it looks good in general. I will need to take a closer look later this week. Let's run the CI workflows first.

Added thiserror crate for Error enums to the api_client package

Signed-off-by: SamrutGadde <samrut.gadde@gmail.com>
Added thiserror crate for missing files in the arch package

Signed-off-by: SamrutGadde <samrut.gadde@gmail.com>
Added thiserror for missing files in the qcow module.

Signed-off-by: SamrutGadde <samrut.gadde@gmail.com>
Updated error enums in device package to use thiserror crate

Signed-off-by: SamrutGadde <samrut.gadde@gmail.com>
Updated error enums in hypervisor under aarch64 to use thiserror crate

Signed-off-by: SamrutGadde <samrut.gadde@gmail.com>
Updated error message for the SocketSendFds error to be more
descriptive.

Signed-off-by: SamrutGadde <samrut.gadde@gmail.com>
Copy link
Member

@likebreath likebreath left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the contributions. LGMT.

@likebreath likebreath added this pull request to the merge queue May 23, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 23, 2024
@likebreath likebreath added this pull request to the merge queue May 23, 2024
Merged via the queue into cloud-hypervisor:main with commit c3d69a9 May 23, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants