Skip to content

Commit 9343661

Browse files
committed
fix(styrojail): clarify the unreachable post-exec error
"styrolite exec failed" was misleading: runner.exec() replaces the process on success and propagates a descriptive error on failure, so this fallback is never expected. Name the runner and state what happened.
1 parent 3f0b5ca commit 9343661

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

bin/styrojail.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{env, path::PathBuf};
22

3-
use anyhow::{Result, anyhow};
3+
use anyhow::{Result, anyhow, bail};
44
use clap::Parser;
55
use styrolite::config::{IdMapping, MountSpec as StyroMountSpec};
66
use styrolite::namespace::Namespace;
@@ -207,5 +207,10 @@ fn main() -> Result<()> {
207207
let runner = Runner::new(&cli.styrolite_bin);
208208
runner.exec(req)?;
209209

210-
Err(anyhow!("styrolite exec failed"))
210+
// exec() replaces this process image on success and returns Err on
211+
// failure (propagated above), so reaching here is never expected.
212+
bail!(
213+
"styrolite runner '{}' returned without exec'ing the workload",
214+
cli.styrolite_bin
215+
)
211216
}

0 commit comments

Comments
 (0)