MCPcopy Index your code
hub / github.com/cargo-lambda/cargo-lambda / init

Function init

crates/cargo-lambda-watch/src/watcher.rs:64–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62}
63
64fn 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
90async fn runtime(
91 cmd: Command,

Callers 1

newFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected