Skip to content

Commit f3bc8b7

Browse files
committed
feat: better tx revert error
1 parent 18de39a commit f3bc8b7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

batcher/aligned-batcher/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ impl Batcher {
11631163
// Since transaction was reverted, we don't want to retry with fallback.
11641164
warn!("Transaction reverted {:?}", err);
11651165

1166-
Err(BatcherError::TransactionSendError)
1166+
Err(BatcherError::TransactionSendError(err))
11671167
}
11681168
Err(_) => {
11691169
let receipt = try_create_new_task(

batcher/aligned-batcher/src/types/errors.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub enum BatcherError {
1212
BatchUploadError(String),
1313
TaskCreationError(String),
1414
ReceiptNotFoundError,
15-
TransactionSendError,
15+
TransactionSendError(String),
1616
MaxRetriesReachedError,
1717
SerializationError(String),
1818
GasPriceError,
@@ -61,8 +61,8 @@ impl fmt::Debug for BatcherError {
6161
BatcherError::ReceiptNotFoundError => {
6262
write!(f, "Receipt not found")
6363
}
64-
BatcherError::TransactionSendError => {
65-
write!(f, "Error sending tx")
64+
BatcherError::TransactionSendError(e) => {
65+
write!(f, "Error sending tx: {}", e)
6666
}
6767
BatcherError::MaxRetriesReachedError => {
6868
write!(
@@ -112,7 +112,7 @@ pub enum BatcherSendError {
112112
impl From<BatcherSendError> for BatcherError {
113113
fn from(value: BatcherSendError) -> Self {
114114
match value {
115-
BatcherSendError::TransactionReverted(_) => BatcherError::TransactionSendError,
115+
BatcherSendError::TransactionReverted(err) => BatcherError::TransactionSendError(err),
116116
BatcherSendError::ReceiptNotFound => BatcherError::ReceiptNotFoundError,
117117
BatcherSendError::UnknownError(err) => BatcherError::TaskCreationError(err),
118118
}

0 commit comments

Comments
 (0)