Skip to content

Commit 6ee4352

Browse files
Skglandsyphar
authored andcommitted
categorize sandbox creation failure
1 parent 1ed0d34 commit 6ee4352

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/cmd/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ pub enum CommandError {
9595
#[error("sandbox image missing from the local system: {0}")]
9696
SandboxImageMissing(#[source] Box<CommandError>),
9797

98+
/// Failed to create the sandbox container
99+
#[error("sandbox container could not be created: {0}")]
100+
SandboxContainerCreate(#[source] Box<CommandError>),
101+
98102
/// Running rustwide inside a Docker container requires the workspace directory to be mounted
99103
/// from the host system. This error happens if that's not true, for example if the workspace
100104
/// lives in a directory inside the container.

src/cmd/sandbox.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ impl SandboxBuilder {
282282

283283
let out = Command::new(workspace, "docker")
284284
.args(&args)
285-
.run_capture()?;
285+
.run_capture()
286+
.map_err(|err| CommandError::SandboxContainerCreate(Box::new(err)))?;
286287
Ok(Container {
287288
id: out.stdout_lines()[0].clone(),
288289
workspace,

0 commit comments

Comments
 (0)