Skip to content

Commit

Permalink
fix main watcher error return
Browse files Browse the repository at this point in the history
  • Loading branch information
cirospaciari committed Aug 1, 2023
1 parent 120ae51 commit f9624bd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/bun.js/node/path_watcher.zig
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ pub const PathWatcherManager = struct {
try main_watcher.addFile(child_path.fd, child_path.path, child_path.hash, options.Loader.file, 0, null, false);
} else {
// watcher died just stop
break;
return error.UnexpectedFailure;
}
} else {
if (watcher.recursive and !watcher.finalized) {
Expand Down Expand Up @@ -492,8 +492,7 @@ pub const PathWatcherManager = struct {

return try DirectoryRegisterTask.schedule(this, watcher, path);
}
watcher.emit("Unable to watch directory", 0, std.time.milliTimestamp(), false, .@"error");
watcher.flush();
return error.UnexpectedFailure;
}

fn registerWatcher(this: *PathWatcherManager, watcher: *PathWatcher) !void {
Expand Down

0 comments on commit f9624bd

Please sign in to comment.