fix(helper): box envelope verification errors
This commit is contained in:
parent
fb53568d37
commit
d089435c2f
1 changed files with 6 additions and 5 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue