Improve error output

- Use consistent casing.
- Emit syscall return value.
reviewable/pr1251/r21
Tamir Duberstein 3 weeks ago
parent 630a767117
commit 6553cd361f
No known key found for this signature in database

@ -96,21 +96,21 @@ pub enum BtfError {
}, },
/// unknown BTF type id /// unknown BTF type id
#[error("Unknown BTF type id `{type_id}`")] #[error("unknown BTF type id `{type_id}`")]
UnknownBtfType { UnknownBtfType {
/// type id /// type id
type_id: u32, type_id: u32,
}, },
/// unexpected btf type id /// unexpected btf type id
#[error("Unexpected BTF type id `{type_id}`")] #[error("unexpected BTF type id `{type_id}`")]
UnexpectedBtfType { UnexpectedBtfType {
/// type id /// type id
type_id: u32, type_id: u32,
}, },
/// unknown BTF type /// unknown BTF type
#[error("Unknown BTF type `{type_name}`")] #[error("unknown BTF type `{type_name}`")]
UnknownBtfTypeName { UnknownBtfTypeName {
/// type name /// type name
type_name: String, type_name: String,
@ -125,7 +125,7 @@ pub enum BtfError {
#[cfg(feature = "std")] #[cfg(feature = "std")]
/// Loading the btf failed /// Loading the btf failed
#[error("the BPF_BTF_LOAD syscall failed. Verifier output: {verifier_log}")] #[error("the BPF_BTF_LOAD syscall returned {io_error}. Verifier output: {verifier_log}")]
LoadError { LoadError {
/// The [`std::io::Error`] returned by the `BPF_BTF_LOAD` syscall. /// The [`std::io::Error`] returned by the `BPF_BTF_LOAD` syscall.
#[source] #[source]

@ -156,7 +156,7 @@ pub enum ProgramError {
NotAttached, NotAttached,
/// Loading the program failed. /// Loading the program failed.
#[error("the BPF_PROG_LOAD syscall failed. Verifier output: {verifier_log}")] #[error("the BPF_PROG_LOAD syscall returned {io_error}. Verifier output: {verifier_log}")]
LoadError { LoadError {
/// The [`io::Error`] returned by the `BPF_PROG_LOAD` syscall. /// The [`io::Error`] returned by the `BPF_PROG_LOAD` syscall.
#[source] #[source]

Loading…
Cancel
Save