cobble_core/error/
launch_error.rs1pub type LaunchResult<T> = Result<T, LaunchError>;
3
4#[derive(Debug, thiserror::Error)]
6#[non_exhaustive]
7pub enum LaunchError {
8 #[error("{0}")]
10 Io(std::io::Error),
11 #[cfg_attr(doc_cfg, doc(cfg(unix)))]
13 #[cfg(unix)]
14 #[error("{0}")]
15 Ipc(ipc_channel::ipc::IpcError),
16 #[cfg_attr(doc_cfg, doc(cfg(unix)))]
18 #[cfg(unix)]
19 #[error("Failed to fork game process")]
20 ProcessForking,
21 #[cfg_attr(doc_cfg, doc(cfg(unix)))]
24 #[cfg(unix)]
25 #[error("Failed to wait for the game process to exit. There may be a zombie process left.")]
26 WaitPid,
27}
28
29impl From<std::io::Error> for LaunchError {
30 fn from(err: std::io::Error) -> Self {
31 Self::Io(err)
32 }
33}
34
35#[cfg(unix)]
36impl From<ipc_channel::ipc::IpcError> for LaunchError {
37 fn from(err: ipc_channel::ipc::IpcError) -> Self {
38 Self::Ipc(err)
39 }
40}