pub struct TransactionScriptError { /* private fields */ }
Expand description
Script execution error with the error source information.
Implementations§
Source§impl TransactionScriptError
impl TransactionScriptError
Sourcepub fn originating_script(&self) -> &TransactionScriptErrorSource
pub fn originating_script(&self) -> &TransactionScriptErrorSource
Originating script for the generated error
Sourcepub fn script_error(&self) -> &ScriptError
pub fn script_error(&self) -> &ScriptError
Actual error generated when verifying script
Trait Implementations§
Source§impl Clone for TransactionScriptError
impl Clone for TransactionScriptError
Source§fn clone(&self) -> TransactionScriptError
fn clone(&self) -> TransactionScriptError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TransactionScriptError
impl Debug for TransactionScriptError
Source§impl Display for TransactionScriptError
impl Display for TransactionScriptError
Source§impl Error for TransactionScriptError
impl Error for TransactionScriptError
It is a deliberate choice here to implement StdError directly, instead of implementing thiserror::Error on TransactionScriptError. This way, calling root_cause() on ckb_error::Error would return TransactionScriptError structure, providing us enough information to inspect on all kinds of errors generated when verifying a script.
This also means calling source() or cause() from std::error::Error on
TransactionScriptError would return None values. One is expected to cast
a value of std::error::Error
type(possibly returned from root_cause) into
concrete TransactionScriptError type, then use the defined methods to fetch
originating script, as well as the actual script error. See the unit test defined
at the end of this file for an example.
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<TransactionScriptError> for Error
impl From<TransactionScriptError> for Error
Source§fn from(error: TransactionScriptError) -> Self
fn from(error: TransactionScriptError) -> Self
Source§impl PartialEq for TransactionScriptError
impl PartialEq for TransactionScriptError
impl Eq for TransactionScriptError
impl StructuralPartialEq for TransactionScriptError
Auto Trait Implementations§
impl !Freeze for TransactionScriptError
impl RefUnwindSafe for TransactionScriptError
impl Send for TransactionScriptError
impl Sync for TransactionScriptError
impl Unpin for TransactionScriptError
impl UnwindSafe for TransactionScriptError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more