mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
Match statement for handling error messages - reverted and default case (#3640)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -161,7 +161,10 @@ impl CallTrace {
|
||||
|
||||
/// Returns the error message if it is an erroneous result.
|
||||
pub(crate) fn as_error(&self) -> Option<String> {
|
||||
self.is_error().then(|| format!("{:?}", self.status))
|
||||
self.is_error().then(|| match self.status {
|
||||
InstructionResult::Revert => "Reverted".to_string(),
|
||||
status => format!("{:?}", status),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user