chore: add more redacted values to machine errors

This commit is contained in:
rvcas 2024-08-15 12:37:17 -04:00 committed by KtorZ
parent 79099675d4
commit e174532bfd
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
1 changed files with 9 additions and 2 deletions

View File

@ -9,7 +9,10 @@ pub enum Error {
OutOfExError(ExBudget), OutOfExError(ExBudget),
#[error("Invalid Stepkind: {0}")] #[error("Invalid Stepkind: {0}")]
InvalidStepKind(u8), InvalidStepKind(u8),
#[error("Cannot evaluate an open term:\\n\\n{}", .0.to_pretty())] #[error(
"Cannot evaluate an open term:\\n{}",
indent(redacted(.0.to_pretty(), 10)),
)]
OpenTermEvaluated(Term<NamedDeBruijn>), OpenTermEvaluated(Term<NamedDeBruijn>),
#[error("The validator crashed / exited prematurely")] #[error("The validator crashed / exited prematurely")]
EvaluationFailure, EvaluationFailure,
@ -47,7 +50,11 @@ pub enum Error {
"A builtin expected a term argument, but something else was received:\n\n{0}\n\nYou probably have an extra force wrapped around a builtin" "A builtin expected a term argument, but something else was received:\n\n{0}\n\nYou probably have an extra force wrapped around a builtin"
)] )]
BuiltinTermArgumentExpected(Term<NamedDeBruijn>), BuiltinTermArgumentExpected(Term<NamedDeBruijn>),
#[error("Unable to unlift value because it is not a constant:\n\n{0:#?}")] #[error(
"Unable to unlift value because it is not a constant\n{:>13} {}",
"Value",
indent(redacted(format!("{:#?}", .0), 10)),
)]
NotAConstant(Value), NotAConstant(Value),
#[error("The evaluation never reached a final state")] #[error("The evaluation never reached a final state")]
MachineNeverReachedDone, MachineNeverReachedDone,