mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 20:27:12 +00:00
Throw bad req error instead
This commit is contained in:
@@ -62,7 +62,7 @@ export const getDNSMadeEasyConnectionListItem = () => {
|
|||||||
|
|
||||||
export const listDNSMadeEasyZones = async (appConnection: TDNSMadeEasyConnection): Promise<TDNSMadeEasyZone[]> => {
|
export const listDNSMadeEasyZones = async (appConnection: TDNSMadeEasyConnection): Promise<TDNSMadeEasyZone[]> => {
|
||||||
if (appConnection.method !== DNSMadeEasyConnectionMethod.APIKeySecret) {
|
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 {
|
const {
|
||||||
@@ -123,7 +123,7 @@ export const listDNSMadeEasyRecords = async (
|
|||||||
options: { zoneId: string; type?: string; name?: string }
|
options: { zoneId: string; type?: string; name?: string }
|
||||||
): Promise<DNSMadeEasyApiResponse["data"]> => {
|
): Promise<DNSMadeEasyApiResponse["data"]> => {
|
||||||
if (appConnection.method !== DNSMadeEasyConnectionMethod.APIKeySecret) {
|
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 {
|
const {
|
||||||
credentials: { apiKey, secretKey }
|
credentials: { apiKey, secretKey }
|
||||||
@@ -187,7 +187,7 @@ export const listDNSMadeEasyRecords = async (
|
|||||||
|
|
||||||
export const validateDNSMadeEasyConnectionCredentials = async (config: TDNSMadeEasyConnectionConfig) => {
|
export const validateDNSMadeEasyConnectionCredentials = async (config: TDNSMadeEasyConnectionConfig) => {
|
||||||
if (config.method !== DNSMadeEasyConnectionMethod.APIKeySecret) {
|
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;
|
const { apiKey, secretKey } = config.credentials;
|
||||||
|
|||||||
Reference in New Issue
Block a user