Skip to main content

xtask_todo_lib/devshell/sandbox/
error.rs

1//! `SandboxError` for export/sync failures.
2
3/// Errors from sandbox export/sync.
4#[derive(Debug)]
5pub enum SandboxError {
6    /// Failed to create temp dir or set permissions.
7    ExportFailed(std::io::Error),
8    /// VFS copy to host failed.
9    CopyFailed(super::super::vfs::VfsError),
10    /// Sync from host back to VFS failed.
11    SyncBackFailed(std::io::Error),
12}
13
14impl std::fmt::Display for SandboxError {
15    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16        match self {
17            Self::ExportFailed(e) => write!(f, "export failed: {e}"),
18            Self::CopyFailed(e) => write!(f, "copy to host failed: {e}"),
19            Self::SyncBackFailed(e) => write!(f, "sync back failed: {e}"),
20        }
21    }
22}
23
24impl std::error::Error for SandboxError {}