Skip to content

Commit 2c23fee

Browse files
authored
Update: Fix error message for backend-wallet (#623)
* Updates: Removed logs + queuedAt indexed * Updates: Error Message for backend-wallets
1 parent 2bd5e9c commit 2c23fee

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/utils/account.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { EVMWallet } from "@thirdweb-dev/wallets";
22
import { Signer, providers } from "ethers";
33

4+
import { StatusCodes } from "http-status-codes";
45
import { Address } from "thirdweb";
56
import { ethers5Adapter } from "thirdweb/adapters/ethers5";
67
import { Account } from "thirdweb/wallets";
78
import { getWalletDetails } from "../db/wallets/getWalletDetails";
89
import { WalletType } from "../schema/wallet";
10+
import { createCustomError } from "../server/middleware/error";
911
import { getAwsKmsWallet } from "../server/utils/wallets/getAwsKmsWallet";
1012
import { getGcpKmsWallet } from "../server/utils/wallets/getGcpKmsWallet";
1113
import {
@@ -35,7 +37,11 @@ export const getAccount = async (args: {
3537
address: from,
3638
});
3739
if (!walletDetails) {
38-
throw new Error(`Backend wallet not found: ${from}`);
40+
throw createCustomError(
41+
`No configured wallet found with address ${from}`,
42+
StatusCodes.BAD_REQUEST,
43+
"BAD_REQUEST",
44+
);
3945
}
4046

4147
let wallet: EVMWallet;

0 commit comments

Comments
 (0)