We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0664f16 + 322a3ec commit 6f946feCopy full SHA for 6f946fe
1 file changed
src/did/src/error.rs
@@ -59,6 +59,9 @@ pub enum EvmError {
59
60
#[error("The request is not valid: {0}")]
61
BadRequest(String),
62
+
63
+ #[error("The transaction has been reverted: {0}")]
64
+ TransactionReverted(String),
65
}
66
67
/// Variant of `TransactionPool` error
@@ -113,10 +116,16 @@ impl From<EvmError> for jsonrpc_core::error::Error {
113
116
EvmError::NotAuthorized => -32002, // NO_AUTHOR
114
117
_ => -32015, // EXECUTION_ERROR
115
118
};
119
120
+ let data = match &err {
121
+ EvmError::TransactionReverted(msg) => Some(msg),
122
+ _ => None,
123
+ };
124
125
Error {
126
code: ErrorCode::ServerError(code),
127
message: err.to_string(),
- data: None,
128
+ data: data.map(|s| s.as_str().into()),
129
130
131
0 commit comments