From 8bdb2720d1d3a16624b441c5c0c93269e1feb6a2 Mon Sep 17 00:00:00 2001
From: chenjiayi <chenjiayi22@huawei.com>
Date: Wed, 21 Jun 2023 21:30:08 +0800
Subject: [PATCH] feature(libbasic): add more error information

Print error source information in addition.
---
 libs/basic/src/error.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libs/basic/src/error.rs b/libs/basic/src/error.rs
index 373ee57..2730883 100644
--- a/libs/basic/src/error.rs
+++ b/libs/basic/src/error.rs
@@ -32,16 +32,16 @@ pub enum Error {
         errno: i32,
     },
 
-    #[snafu(display("Io"))]
+    #[snafu(display("Io: {}", source))]
     Io { source: std::io::Error },
 
-    #[snafu(display("Errno"))]
+    #[snafu(display("Errno: {}", source))]
     Nix { source: nix::Error },
 
-    #[snafu(display("Var"))]
+    #[snafu(display("Var: {}", source))]
     Var { source: std::env::VarError },
 
-    #[snafu(display("procfs"))]
+    #[snafu(display("procfs: {}", source))]
     Proc { source: procfs::ProcError },
 
     #[snafu(display("Error parsing from string: {}", source))]
-- 
2.33.0

