commit: 12c014335408617a6b42fe9b20961fcf48fdd92d
parent f2893cbeda686082b8f627016ad89358eefbb314
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sat, 16 Nov 2024 07:40:16 +0100
Prefix all error messages with "deblob: error: "
Diffstat:
M | main.ha | 26 | +++++++++++++------------- |
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/main.ha b/main.ha
@@ -200,7 +200,7 @@ fn id_blob(filename: str) (void | str | fs::error | io::error) = {
continue;
case let s: str =>
fmt::fatalf(
- "deblob: id_blob({}) got wrongly detected as: {}",
+ "deblob: error: id_blob({}) got wrongly detected as: {}",
sources[i], s
);
};
@@ -246,14 +246,14 @@ fn id_blob(filename: str) (void | str | fs::error | io::error) = {
match(id_blob(blobs[i].1)!) {
case void =>
fmt::fatalf(
- "deblob: id_blob({}) didn't got detected as: {}",
+ "deblob: error: id_blob({}) didn't got detected as: {}",
blobs[i].1, blobs[i].0
);
case let s: str =>
if(s != blobs[i].0)
{
fmt::fatalf(
- "deblob: id_blob({}) got identified as \"{}\" instead of \"{}\"",
+ "deblob: error: id_blob({}) got identified as \"{}\" instead of \"{}\"",
blobs[i].1, s, blobs[i].0
);
};
@@ -302,7 +302,7 @@ fn check_dir(dirname: str) (void | errors::invalid | io::error) = {
case let iter: *fs::iterator =>
yield iter;
case let err: fs::error =>
- fmt::errorfln("deblob: Filesystem error os::iter({}): {}", dirname, fs::strerror(err))!;
+ fmt::errorfln("deblob: error: Failed walking directory '{}': {}", dirname, fs::strerror(err))!;
return errors::invalid;
};
defer fs::finish(iter);
@@ -312,7 +312,7 @@ fn check_dir(dirname: str) (void | errors::invalid | io::error) = {
case let ent: fs::dirent =>
yield ent;
case let e: fs::error =>
- fmt::errorfln("deblob: Filesystem error while reading directory '{}': {}", dirname, fs::strerror(e))?;
+ fmt::errorfln("deblob: error: Failed walking directory '{}': {}", dirname, fs::strerror(e))?;
break;
case done =>
break;
@@ -330,11 +330,11 @@ fn check_dir(dirname: str) (void | errors::invalid | io::error) = {
case let s: str =>
yield s;
case let err: fs::error =>
- fmt::errorfln("deblob: Error opening {}: {}",
+ fmt::errorfln("deblob: error: Failed opening {}: {}",
filename, fs::strerror(err))!;
continue;
case let err: io::error =>
- fmt::errorfln("deblob: Error reading {}: {}",
+ fmt::errorfln("deblob: error: Failed reading {}: {}",
filename, io::strerror(err))!;
continue;
};
@@ -360,7 +360,7 @@ fn check_dir(dirname: str) (void | errors::invalid | io::error) = {
case void =>
continue;
case let e: fs::error =>
- fmt::errorfln("deblob: os::remove({}):\t{}",
+ fmt::errorfln("deblob: error: Failed removing file '{}':\t{}",
filename, fs::strerror(e))!;
};
} else {
@@ -377,7 +377,7 @@ fn check_dir(dirname: str) (void | errors::invalid | io::error) = {
case let d: []fs::dirent =>
yield d;
case let e: fs::error =>
- fmt::fatalf("deblob: os::readdir({}): {}", dirname, fs::strerror(e));
+ fmt::fatalf("deblob: error: os::readdir({}): {}", dirname, fs::strerror(e));
};
assert(len(files_before) == 60);
@@ -388,7 +388,7 @@ fn check_dir(dirname: str) (void | errors::invalid | io::error) = {
case let d: []fs::dirent =>
yield d;
case let e: fs::error =>
- fmt::fatalf("deblob: os::readdir({}): {}", dirname, fs::strerror(e));
+ fmt::fatalf("deblob: error: os::readdir({}): {}", dirname, fs::strerror(e));
};
assert(len(files_after) == 30);
};
@@ -423,7 +423,7 @@ export fn main() void = {
json = true;
json_out_path = opt.1;
case =>
- fmt::fatalf("deblob: Unhandled option -{}", opt.0);
+ fmt::fatalf("deblob: error: Unhandled option -{}", opt.0);
};
};
@@ -443,7 +443,7 @@ export fn main() void = {
{
match (os::chdir(opt_d)) {
case let e: fs::error =>
- fmt::fatalf("deblob: os::chdir({}): {}", opt_d, fs::strerror(e));
+ fmt::fatalf("deblob: error: Failed changing current directory to '{}': {}", opt_d, fs::strerror(e));
case void =>
void;
};
@@ -475,7 +475,7 @@ export fn main() void = {
case errors::invalid =>
os::exit(1);
case let e: io::error =>
- fmt::errorfln("deblob: I/O error while traversing directories: {}", io::strerror(e))!;
+ fmt::errorfln("deblob: error: I/O error while traversing directories: {}", io::strerror(e))!;
os::exit(1);
};
};