Skip to content

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 <[email protected]>
@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 For PRs adding features, improving functionality, docs, tests, etc. label Nov 12, 2024
Signed-off-by: Ludvig Liljenberg <[email protected]>
@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 For PRs adding features, improving functionality, docs, tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants