-
Notifications
You must be signed in to change notification settings - Fork 290
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
fix unsupported maps warning message #1092
fix unsupported maps warning message #1092
Conversation
✅ Deploy Preview for aya-rs-docs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks good. Please run CARGO_CFG_BPF_TARGET_ARCH=x86_64 cargo +nightly xtask public-api --bless --target x86_64-unknown-linux-gnu
to regenerate the API file.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @banditopazzo)
aya/src/maps/mod.rs
line 198 at r1 (raw file):
/// Unsupported Map type #[error("the map {name} is of type {map_type:#?} which is currently unsupported in Aya, use `allow_unsupported_maps()` to load it anyways")]
can we make this a little shorter? seems way too long.
b87361f
to
3f5ce23
Compare
Hey @alessandrod, this pull request changes the Aya Public API and requires your review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @alessandrod and @banditopazzo)
aya/src/maps/mod.rs
line 198 at r2 (raw file):
/// Unsupported Map type #[error("map {name} is of type {map_type:#?}, unsupported in Aya; use `allow_unsupported_maps()` to load it")]
Why do we need {:#?}
rather than {:?}
?
#[error("type of {name} ({map_type:?}) is unsupported; see `EbpfLoader::allow_unsupported_maps`")]
Code quote:
#[error("map {name} is of type {map_type:#?}, unsupported in Aya; use `allow_unsupported_maps()` to load it")]
Remove the warning log altogether; either it's an error or it isn't.
3f5ce23
to
a1cacec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @alessandrod)
Thanks! |
fix #1081
the proposed solution is to remove the warning log and instead provide more meaningful information directly within the error itself.
without considering the issue, right now we have just a warning log (which contains the important information), but this is misleading since it actually leads to an error. I believe this can cause confusion because the critical details should be part of the error itself. For this reason I consolidated all the relevant information into the error message.
Additionally, I updated the
map_type
field type inUnsupported
error fromu32
tobpf_map_type
, as an unsupported map has a specific map type, which is distinct from a genericu32
used in cases like theInvalidMapType
error.PS: Regarding
InvalidMapType
and other map-related errors, I believe they should also include the names of the maps.This change is