From 4d200f029093a81a7ca18866420b00ee1e90354b Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Thu, 15 May 2025 11:56:46 -0400 Subject: [PATCH] Improve error output - Use consistent casing. - Emit syscall return value. --- aya-obj/src/btf/btf.rs | 8 ++++---- aya/src/programs/mod.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/aya-obj/src/btf/btf.rs b/aya-obj/src/btf/btf.rs index e08c8c9e..ab300316 100644 --- a/aya-obj/src/btf/btf.rs +++ b/aya-obj/src/btf/btf.rs @@ -96,21 +96,21 @@ pub enum BtfError { }, /// unknown BTF type id - #[error("Unknown BTF type id `{type_id}`")] + #[error("unknown BTF type id `{type_id}`")] UnknownBtfType { /// type id type_id: u32, }, /// unexpected btf type id - #[error("Unexpected BTF type id `{type_id}`")] + #[error("unexpected BTF type id `{type_id}`")] UnexpectedBtfType { /// type id type_id: u32, }, /// unknown BTF type - #[error("Unknown BTF type `{type_name}`")] + #[error("unknown BTF type `{type_name}`")] UnknownBtfTypeName { /// type name type_name: String, @@ -125,7 +125,7 @@ pub enum BtfError { #[cfg(feature = "std")] /// 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 { /// The [`std::io::Error`] returned by the `BPF_BTF_LOAD` syscall. #[source] diff --git a/aya/src/programs/mod.rs b/aya/src/programs/mod.rs index fa1e41ec..f0e2df79 100644 --- a/aya/src/programs/mod.rs +++ b/aya/src/programs/mod.rs @@ -156,7 +156,7 @@ pub enum ProgramError { NotAttached, /// 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 { /// The [`io::Error`] returned by the `BPF_PROG_LOAD` syscall. #[source]