mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 20:27:12 +00:00
throw only error and remove bool return
This commit is contained in:
@@ -107,10 +107,8 @@ export const AwsKmsProviderFactory = async ({ inputs }: AwsKmsProviderArgs): Pro
|
|||||||
const cleanup = async () => {
|
const cleanup = async () => {
|
||||||
try {
|
try {
|
||||||
awsClient.destroy();
|
awsClient.destroy();
|
||||||
return true;
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(error, "cleanup: failed to destroy AWS KMS client");
|
throw new Error("Failed to cleanup AWS KMS client", { cause: error });
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -48,10 +48,8 @@ export const GcpKmsProviderFactory = async ({ inputs }: GcpKmsProviderArgs): Pro
|
|||||||
const cleanup = async () => {
|
const cleanup = async () => {
|
||||||
try {
|
try {
|
||||||
await gcpKmsClient.close();
|
await gcpKmsClient.close();
|
||||||
return true;
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error(error, "cleanup: failed to close GCP KMS client");
|
throw new Error("Failed to cleanup GCP KMS client", { cause: error });
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -98,5 +98,5 @@ export type TExternalKmsProviderFns = {
|
|||||||
validateConnection: () => Promise<boolean>;
|
validateConnection: () => Promise<boolean>;
|
||||||
encrypt: (data: Buffer) => Promise<{ encryptedBlob: Buffer }>;
|
encrypt: (data: Buffer) => Promise<{ encryptedBlob: Buffer }>;
|
||||||
decrypt: (encryptedBlob: Buffer) => Promise<{ data: Buffer }>;
|
decrypt: (encryptedBlob: Buffer) => Promise<{ data: Buffer }>;
|
||||||
cleanup: () => Promise<boolean>;
|
cleanup: () => Promise<void>;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user