File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/server/routes/transaction/blockchain Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
1212 type Hex ,
1313} from "thirdweb" ;
1414import { resolveContractAbi } from "thirdweb/contract" ;
15+ import { TransactionReceipt } from "thirdweb/transaction" ;
1516import { TransactionDB } from "../../../../db/transactions/db" ;
1617import { getChain } from "../../../../utils/chain" ;
1718import { thirdwebClient } from "../../../../utils/sdk" ;
@@ -168,12 +169,14 @@ export async function getTransactionLogs(fastify: FastifyInstance) {
168169 }
169170
170171 // Try to get the receipt.
171- const transactionReceipt = await eth_getTransactionReceipt ( rpcRequest , {
172- hash,
173- } ) ;
174- if ( ! transactionReceipt ) {
172+ let transactionReceipt : TransactionReceipt | undefined ;
173+ try {
174+ transactionReceipt = await eth_getTransactionReceipt ( rpcRequest , {
175+ hash,
176+ } ) ;
177+ } catch {
175178 throw createCustomError (
176- "Cannot get logs for a transaction that is not mined." ,
179+ "Unable to get transaction receipt. The transaction may not have been mined yet ." ,
177180 StatusCodes . BAD_REQUEST ,
178181 "TRANSACTION_NOT_MINED" ,
179182 ) ;
You can’t perform that action at this time.
0 commit comments