| 62 | } |
| 63 | |
| 64 | fn init() -> InitConfig { |
| 65 | let mut config = InitConfig::default(); |
| 66 | config.on_error(SyncFnHandler::from( |
| 67 | |err: ErrorHook| -> std::result::Result<(), Infallible> { |
| 68 | match err.error { |
| 69 | RuntimeError::IoError { |
| 70 | // according to watchexec's documentation, this errors can be ignored. |
| 71 | // see: https://github.com/watchexec/watchexec/blob/e06dc0dd16f8aa88a1556583eafbd985ca2c4eea/crates/lib/src/error/runtime.rs#L13-L15 |
| 72 | about: "waiting on process group", |
| 73 | .. |
| 74 | } => {} |
| 75 | RuntimeError::FsWatcher { .. } | RuntimeError::EventChannelTrySend { .. } => { |
| 76 | err.elevate() |
| 77 | } |
| 78 | e => { |
| 79 | error!(error = ?e, "internal error watching your project"); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | Ok(()) |
| 84 | }, |
| 85 | )); |
| 86 | |
| 87 | config |
| 88 | } |
| 89 | |
| 90 | async fn runtime( |
| 91 | cmd: Command, |