Skip to content

Commit

Permalink
fix: avoid error strings duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
luisantoniocrag committed Nov 5, 2024
1 parent 49c8a23 commit 9c3526e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/handlers/generate-erc721-permit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@ export async function generateErc721PermitSignature(
_logger = contextOrPermitPayload.logger;

if (!NFT_MINTER_PRIVATE_KEY) {
_logger.error("NFT minter private key is not defined");
throw new Error("NFT minter private key is not defined");
const errorMessage = "NFT minter private key is not defined";
_logger.error(errorMessage);
throw new Error(errorMessage);
}

if (!NFT_CONTRACT_ADDRESS) {
_logger.error("NFT contract address is not defined");
throw new Error("NFT contract address is not defined");
const errorMessage = "NFT contract address is not defined";
_logger.error(errorMessage);
throw new Error(errorMessage);
}

const { evmNetworkId } = contextOrPermitPayload.config;
Expand Down

0 comments on commit 9c3526e

Please sign in to comment.