File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
import type { EVMWallet } from "@thirdweb-dev/wallets" ;
2
2
import { AwsKmsWallet } from "@thirdweb-dev/wallets/evm/wallets/aws-kms" ;
3
3
import { GcpKmsWallet } from "@thirdweb-dev/wallets/evm/wallets/gcp-kms" ;
4
+ import { StatusCodes } from "http-status-codes" ;
4
5
import { getWalletDetails } from "../../db/wallets/getWalletDetails" ;
5
6
import type { PrismaTransaction } from "../../schema/prisma" ;
6
7
import { WalletType } from "../../schema/wallet" ;
8
+ import { createCustomError } from "../../server/middleware/error" ;
7
9
import { splitAwsKmsArn } from "../../server/utils/wallets/awsKmsArn" ;
8
10
import { splitGcpKmsResourcePath } from "../../server/utils/wallets/gcpKmsResourcePath" ;
9
11
import { getLocalWallet } from "../../server/utils/wallets/getLocalWallet" ;
@@ -40,7 +42,11 @@ export const getWallet = async <TWallet extends EVMWallet>({
40
42
} ) ;
41
43
42
44
if ( ! walletDetails ) {
43
- throw new Error ( `No configured wallet found with address ${ walletAddress } ` ) ;
45
+ throw createCustomError (
46
+ `No configured wallet found with address ${ walletAddress } ` ,
47
+ StatusCodes . BAD_REQUEST ,
48
+ "BAD_REQUEST" ,
49
+ ) ;
44
50
}
45
51
46
52
const config = await getConfig ( ) ;
You can’t perform that action at this time.
0 commit comments