Skip to content

Commit e25bdfd

Browse files
committed
fix: add response to the waitForTx error
1 parent f2fe113 commit e25bdfd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/provider/default.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,10 @@ export class Provider implements ProviderInterface {
289289

290290
if (res.tx_status === 'ACCEPTED_ON_L1' || res.tx_status === 'ACCEPTED_ON_L2') {
291291
onchain = true;
292-
} else if (res.tx_status === 'REJECTED') {
293-
throw Error('REJECTED');
294-
} else if (res.tx_status === 'NOT_RECEIVED') {
295-
throw Error('NOT_RECEIVED');
292+
} else if (res.tx_status === 'REJECTED' || res.tx_status === 'NOT_RECEIVED') {
293+
const error = Error(res.tx_status) as Error & { response: GetTransactionStatusResponse };
294+
error.response = res;
295+
throw error;
296296
}
297297
}
298298
}

0 commit comments

Comments
 (0)