commit 0da4a7f4432747d52c03b05913b7fdec66e44f4d
parent 363f3ca788d3bd06596e7636727278eae28a21c8
Author: Stefan Koch <programming@stefan-koch.name>
Date: Sun, 10 May 2020 11:50:32 +0200
add filepath to error message
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/dashboard.rs b/src/dashboard.rs
@@ -22,14 +22,14 @@ pub fn generate_status_icon(project: &str, branch: &str, status: BuildStatus, di
path.push(format!("{}.png", branch));
// TODO: Error handling
- let mut buffer = File::create(path).unwrap();
+ let mut buffer = File::create(path.clone()).unwrap();
let result = match status {
BuildStatus::Success => buffer.write(ICON_SUCCESS),
BuildStatus::Error(_) => buffer.write(ICON_ERROR),
};
if let Err(msg) = result {
- return Err(format!("{}", msg));
+ return Err(format!("{}, File: {}", msg, path.to_string_lossy()));
}
Ok(())