Skip to content

Commit

Permalink
let ckb_vm::Error::External("stopped") return ErrorKind::Internal ins…
Browse files Browse the repository at this point in the history
…tead of ErrorKind::Script
  • Loading branch information
eval-exec committed Oct 29, 2024
1 parent 8cb49e4 commit 753b86c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion script/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,13 @@ impl ScriptError {

impl From<TransactionScriptError> for Error {
fn from(error: TransactionScriptError) -> Self {
ErrorKind::Script.because(error)
// check error.cause is ScriptError::Other("stopped")?
match error.cause {
ScriptError::Other(ref reason) if reason == "stopped" => {
ErrorKind::Internal.because(error)
}
_ => ErrorKind::Script.because(error),
}
}
}

Expand Down

0 comments on commit 753b86c

Please sign in to comment.