瀏覽代碼

Expose inner errors

Currently aya will just report a standard outer level
error on failure.  Ensure that we also report the inner
error condition back to the user

Signed-off-by: Andrew Stoycos <astoycos@redhat.com>
Andrew Stoycos 2 年之前
父節點
當前提交
1899d5f4fd
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      aya/src/bpf.rs

+ 4 - 4
aya/src/bpf.rs

@@ -857,11 +857,11 @@ pub enum BpfError {
     },
 
     /// Error parsing BPF object
-    #[error("error parsing BPF object")]
+    #[error("error parsing BPF object: {0}")]
     ParseError(#[from] ParseError),
 
     /// Error parsing BTF object
-    #[error("BTF error")]
+    #[error("BTF error: {0}")]
     BtfError(#[from] BtfError),
 
     /// Error performing relocations
@@ -876,11 +876,11 @@ pub enum BpfError {
     #[error("no BTF parsed for object")]
     NoBTF,
 
-    #[error("map error")]
+    #[error("map error: {0}")]
     /// A map error
     MapError(#[from] MapError),
 
-    #[error("program error")]
+    #[error("program error: {0}")]
     /// A program error
     ProgramError(#[from] ProgramError),
 }