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 {
12
12
type Hex ,
13
13
} from "thirdweb" ;
14
14
import { resolveContractAbi } from "thirdweb/contract" ;
15
+ import { TransactionReceipt } from "thirdweb/transaction" ;
15
16
import { TransactionDB } from "../../../../db/transactions/db" ;
16
17
import { getChain } from "../../../../utils/chain" ;
17
18
import { thirdwebClient } from "../../../../utils/sdk" ;
@@ -168,12 +169,14 @@ export async function getTransactionLogs(fastify: FastifyInstance) {
168
169
}
169
170
170
171
// 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 {
175
178
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 ." ,
177
180
StatusCodes . BAD_REQUEST ,
178
181
"TRANSACTION_NOT_MINED" ,
179
182
) ;
You can’t perform that action at this time.
0 commit comments