feat: introduce miette into uplc

This commit is contained in:
rvcas
2023-03-08 01:09:00 -05:00
committed by KtorZ
parent cb11b21c9f
commit 4f1d14f2a0
4 changed files with 5 additions and 3 deletions

View File

@@ -6,13 +6,13 @@ use crate::ast::{NamedDeBruijn, Term, Type};
use super::{ExBudget, Value};
#[derive(thiserror::Error, Debug)]
#[derive(thiserror::Error, Debug, miette::Diagnostic)]
pub enum Error {
#[error("Over budget mem: {} & cpu: {}", .0.mem, .0.cpu)]
OutOfExError(ExBudget),
#[error("Invalid Stepkind: {0}")]
InvalidStepKind(u8),
#[error("Cannot evaluate an open term:\n\n{0}")]
#[error("Cannot evaluate an open term:\\n\\n{}", .0.to_pretty())]
OpenTermEvaluated(Term<NamedDeBruijn>),
#[error("The provided Plutus code called 'error'.")]
EvaluationFailure,

View File

@@ -1,6 +1,6 @@
use crate::machine::{self, cost_model::ExBudget};
#[derive(thiserror::Error, Debug)]
#[derive(thiserror::Error, Debug, miette::Diagnostic)]
pub enum Error {
#[error("{0}")]
Address(#[from] pallas_addresses::Error),