Watch
1
0
Fork
You've already forked RedFlag
0

fix(helper): box envelope verification errors

This commit is contained in:
Fimeg 2026-08-31 21:03:12 -04:00
commit d089435c2f

View file

@ -2869,15 +2869,15 @@ mod pacman_envelope_tests {
fn verify_envelope(
envelope_file: &str,
now: i64,
) -> Result<MutationEnvelope, (Option<MutationEnvelope>, Denial)> {
let envelope = read_envelope_from_file(envelope_file).map_err(|d| (None, d))?;
) -> Result<MutationEnvelope, Box<(Option<MutationEnvelope>, Denial)>> {
let envelope = read_envelope_from_file(envelope_file).map_err(|d| Box::new((None, d)))?;
// Evaluate the denial before moving the envelope into the return — every
// detail string reads from it.
macro_rules! deny {
($d:expr) => {{
let denial = $d;
return Err((Some(envelope), denial));
return Err(Box::new((Some(envelope), denial)));
}};
}
@ -3048,7 +3048,7 @@ fn run_envelope(envelope_file: &str, now: i64) -> (Option<MutationEnvelope>, Den
),
)
}
Err(result) => result,
Err(result) => *result,
}
}
@ -3256,7 +3256,8 @@ fn run_execute_envelope_cli(args: &[String]) -> i32 {
)
}
},
Err((envelope, denial)) => {
Err(result) => {
let (envelope, denial) = *result;
let decision = if denial.code == EXIT_EXEC_FAILED {
"failed"
} else {