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

Improve error when guest binary not found #55

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

ludfjig
Copy link
Contributor

@ludfjig ludfjig commented Nov 12, 2024

When the given GuestBinary is not found, the error now includes the actual path that wasn't found.
Also:

  • Removes a call to try_exists, which is unnecessary since canonicalize will already fail if the file doesn't exit.
  • Removes an unnecessary recreation of matched pattern for GuestBinary::Buffer.
  • Converts PathBuf to String in a more ideomatic way and removes potential panic if PathBuf cannot be converted to String (i.e. not utf8 encoded)

@ludfjig ludfjig force-pushed the better_error branch 2 times, most recently from 996c8ae to 3b02753 Compare November 12, 2024 18:50
…exists, and fix unnecessary recreation of matched pattern

Signed-off-by: Ludvig Liljenberg <lliljenberg@microsoft.com>
@ludfjig ludfjig force-pushed the better_error branch 2 times, most recently from e9bb57b to 65a700f Compare November 12, 2024 22:11
@ludfjig ludfjig added the kind/enhancement New feature or request label Nov 12, 2024
Signed-off-by: Ludvig Liljenberg <lliljenberg@microsoft.com>
@ludfjig ludfjig merged commit 9724750 into hyperlight-dev:main Nov 13, 2024
22 checks passed
@ludfjig ludfjig deleted the better_error branch November 13, 2024 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants