diff --git a/script/src/error.rs b/script/src/error.rs index 094671d6e3..a6cfcc28a0 100644 --- a/script/src/error.rs +++ b/script/src/error.rs @@ -44,6 +44,10 @@ pub enum ScriptError { #[error("VM Internal Error: {0:?}")] VMInternalError(VMInternalError), + /// Interrupts, such as a Ctrl-C signal + #[error("VM Interrupts")] + Interrupts, + /// Other errors raised in script execution process #[error("Other Error: {0}")] Other(String), @@ -183,9 +187,7 @@ impl ScriptError { impl From for Error { fn from(error: TransactionScriptError) -> Self { match error.cause { - ScriptError::Other(ref reason) if reason == "stopped" => { - ErrorKind::Internal.because(error) - } + ScriptError::Interrupts => ErrorKind::Internal.because(error), _ => ErrorKind::Script.because(error), } }