miden_testing/tx_context/
errors.rs1use alloc::string::ToString;
2
3use miden_processor::ExecutionError;
4use miden_protocol::assembly::diagnostics::reporting::PrintDiagnostic;
5use thiserror::Error;
6
7#[derive(Debug, Error)]
13#[error("{}", PrintDiagnostic::new(.0).to_string())]
14pub struct ExecError(pub ExecutionError);
15
16impl ExecError {
17 pub fn new(error: ExecutionError) -> Self {
19 Self(error)
20 }
21
22 pub fn as_execution_error(&self) -> &ExecutionError {
24 &self.0
25 }
26
27 pub fn into_execution_error(self) -> ExecutionError {
29 self.0
30 }
31}