mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
error: introduce thiserror to add path to error message
For some cgroup file operations, when failed, add the path and the value (for write operation) to the error message. Fixes: #93 Signed-off-by: bin liu <liubin0329@gmail.com>
This commit is contained in:
+3
-2
@@ -88,8 +88,9 @@ impl NetClsController {
|
||||
self.open_path("net_cls.classid", true)
|
||||
.and_then(|mut file| {
|
||||
let s = format!("{:#08X}", class);
|
||||
file.write_all(s.as_ref())
|
||||
.map_err(|e| Error::with_cause(WriteFailed, e))
|
||||
file.write_all(s.as_ref()).map_err(|e| {
|
||||
Error::with_cause(WriteFailed("net_cls.classid".to_string(), s), e)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user