diff options
Diffstat (limited to 'crates/typst-cli/src/watch.rs')
| -rw-r--r-- | crates/typst-cli/src/watch.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/typst-cli/src/watch.rs b/crates/typst-cli/src/watch.rs index b320c651..f53cb5fd 100644 --- a/crates/typst-cli/src/watch.rs +++ b/crates/typst-cli/src/watch.rs @@ -25,7 +25,7 @@ pub fn watch(mut command: CompileCommand) -> StrResult<()> { // Setup file watching. let (tx, rx) = std::sync::mpsc::channel(); let mut watcher = RecommendedWatcher::new(tx, notify::Config::default()) - .map_err(|_| "failed to setup file watching")?; + .map_err(|err| eco_format!("failed to setup file watching ({err})"))?; // Watch all the files that are used by the input file and its dependencies. watch_dependencies(&mut world, &mut watcher, HashSet::new())?; @@ -41,7 +41,8 @@ pub fn watch(mut command: CompileCommand) -> StrResult<()> { .into_iter() .chain(std::iter::from_fn(|| rx.recv_timeout(timeout).ok())) { - let event = event.map_err(|_| "failed to watch directory")?; + let event = + event.map_err(|err| eco_format!("failed to watch directory ({err})"))?; // Workaround for notify-rs' implicit unwatch on remove/rename // (triggered by some editors when saving files) with the inotify @@ -94,7 +95,7 @@ fn watch_dependencies( tracing::info!("Watching {}", path.display()); watcher .watch(path, RecursiveMode::NonRecursive) - .map_err(|_| eco_format!("failed to watch {path:?}"))?; + .map_err(|err| eco_format!("failed to watch {path:?} ({err})"))?; } } |
