Skip to content

Commit

Permalink
fix: prevent .env related error from blocking version release
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoAguzzi committed Mar 19, 2024
1 parent b640b5c commit 269b66e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/client/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,11 @@ export const getAPIKeyForNetwork: Map<number, string | undefined> = new Map([
export const getCurrentNetworkHttpUrl = (chainId: number) => {
const httpUrl = getRpcHttpUrlForNetwork.get(chainId);

if (!httpUrl)
throw new Error(`No RPC URL was defined for chain ID: ${chainId}`);
if (!httpUrl) {
if (process.env.NODE_ENV === "production")
throw new Error(`No RPC URL was defined for chain ID: ${chainId}`);
else console.error(`No RPC URL was defined for chain ID: ${chainId}`);
}

return httpUrl;
};
Expand Down

0 comments on commit 269b66e

Please sign in to comment.