Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Throw bad req error instead

Fang-Pen Lin928aa07efa16
diff --git a/backend/src/services/app-connection/dns-made-easy/dns-made-easy-connection-fns.ts b/backend/src/services/app-connection/dns-made-easy/dns-made-easy-connection-fns.ts
index b66d6eb9cd..9d1941ff3c 100644
--- a/backend/src/services/app-connection/dns-made-easy/dns-made-easy-connection-fns.ts
+++ b/backend/src/services/app-connection/dns-made-easy/dns-made-easy-connection-fns.ts
@@ -62,7 +62,7 @@ export const getDNSMadeEasyConnectionListItem = () => {
export const listDNSMadeEasyZones = async (appConnection: TDNSMadeEasyConnection): Promise<TDNSMadeEasyZone[]> => {
if (appConnection.method !== DNSMadeEasyConnectionMethod.APIKeySecret) {
- throw new Error("Unsupported DNS Made Easy connection method");
+ throw new BadRequestError({ message: "Unsupported DNS Made Easy connection method" });
}
const {
@@ -123,7 +123,7 @@ export const listDNSMadeEasyRecords = async (
options: { zoneId: string; type?: string; name?: string }
): Promise<DNSMadeEasyApiResponse["data"]> => {
if (appConnection.method !== DNSMadeEasyConnectionMethod.APIKeySecret) {
- throw new Error("Unsupported DNS Made Easy connection method");
+ throw new BadRequestError({ message: "Unsupported DNS Made Easy connection method" });
}
const {
credentials: { apiKey, secretKey }
@@ -187,7 +187,7 @@ export const listDNSMadeEasyRecords = async (
export const validateDNSMadeEasyConnectionCredentials = async (config: TDNSMadeEasyConnectionConfig) => {
if (config.method !== DNSMadeEasyConnectionMethod.APIKeySecret) {
- throw new Error("Unsupported DNS Made Easy connection method");
+ throw new BadRequestError({ message: "Unsupported DNS Made Easy connection method" });
}
const { apiKey, secretKey } = config.credentials;