lanzatool: add context to sbsing output failure

This commit is contained in:
nikstur 2022-12-31 02:57:01 +01:00
parent b592d92744
commit 1e632c0d1d
1 changed files with 4 additions and 2 deletions

View File

@ -3,7 +3,7 @@ use std::io::Write;
use std::path::{Path, PathBuf};
use std::process::Command;
use anyhow::Result;
use anyhow::{Context, Result};
pub struct KeyPair {
pub private_key: PathBuf,
@ -32,7 +32,9 @@ impl KeyPair {
let output = Command::new("sbsign").args(&args).output()?;
if !output.status.success() {
std::io::stderr().write_all(&output.stderr).unwrap();
std::io::stderr()
.write_all(&output.stderr)
.context("Failed to write output of sbsign to stderr")?;
return Err(anyhow::anyhow!(
"Failed to sign file using sbsign with args `{:?}`",
&args