mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 15:28:42 +00:00
refactor: improve error handling for gateway connection in LDAP functions
This commit is contained in:
@@ -124,7 +124,10 @@ export const executeWithPotentialGateway = async <T>(
|
|||||||
targetPort: port
|
targetPort: port
|
||||||
});
|
});
|
||||||
|
|
||||||
if (platformConnectionDetails) {
|
if (!platformConnectionDetails) {
|
||||||
|
throw new BadRequestError({ message: "Unable to connect to gateway, no platform connection details found" });
|
||||||
|
}
|
||||||
|
|
||||||
return withGatewayV2Proxy(
|
return withGatewayV2Proxy(
|
||||||
async (proxyPort) => {
|
async (proxyPort) => {
|
||||||
const proxyUrl = constructLdapUrl(protocol, "localhost", proxyPort);
|
const proxyUrl = constructLdapUrl(protocol, "localhost", proxyPort);
|
||||||
@@ -161,7 +164,6 @@ export const executeWithPotentialGateway = async <T>(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Non-gateway path - calls getLdapConnectionClient which has validation
|
// Non-gateway path - calls getLdapConnectionClient which has validation
|
||||||
const client = await getLdapConnectionClient(credentials);
|
const client = await getLdapConnectionClient(credentials);
|
||||||
|
|||||||
Reference in New Issue
Block a user