commit: 418640113513f4e3df3eef52fa6b286f063de40f
parent 901425b25a1f46b49e7f81cd0ad6c34525e5eb82
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sun, 14 Jul 2024 17:45:27 +0200
Changes for hare 0.24.2
Diffstat:
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/main.ha b/main.ha
@@ -231,7 +231,7 @@ fn is_excluded(filename: str) bool = {
return false;
};
-fn check_dir(dirname: str) (void | errors::invalid) = {
+fn check_dir(dirname: str) (void | errors::invalid | io::error) = {
const iter = match (os::iter(dirname)) {
case let iter: *fs::iterator =>
yield iter;
@@ -242,12 +242,13 @@ fn check_dir(dirname: str) (void | errors::invalid) = {
defer fs::finish(iter);
for (true) {
- const ent = match (fs::next(iter)) {
+ const ent: fs::dirent = match (fs::next(iter)) {
case let ent: fs::dirent =>
yield ent;
case let e: fs::error =>
- fmt::errorfln("deblob: Filesystem error while reading directory '{}': {}", dirname, fs::strerror(e));
- case void =>
+ fmt::errorfln("deblob: Filesystem error while reading directory '{}': {}", dirname, fs::strerror(e))?;
+ break;
+ case done =>
break;
};
@@ -364,5 +365,8 @@ export fn main() void = {
os::exit(0);
case errors::invalid =>
os::exit(1);
+ case let e: io::error =>
+ fmt::errorfln("deblob: I/O error while traversing directories: {}", io::strerror(e))!;
+ os::exit(2);
};
};