mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +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 () => {
|
||||
try {
|
||||
awsClient.destroy();
|
||||
return true;
|
||||
} catch (error) {
|
||||
logger.error(error, "cleanup: failed to destroy AWS KMS client");
|
||||
return false;
|
||||
throw new Error("Failed to cleanup AWS KMS client", { cause: error });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -48,10 +48,8 @@ export const GcpKmsProviderFactory = async ({ inputs }: GcpKmsProviderArgs): Pro
|
||||
const cleanup = async () => {
|
||||
try {
|
||||
await gcpKmsClient.close();
|
||||
return true;
|
||||
} catch (error) {
|
||||
logger.error(error, "cleanup: failed to close GCP KMS client");
|
||||
return false;
|
||||
throw new Error("Failed to cleanup GCP KMS client", { cause: error });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -98,5 +98,5 @@ export type TExternalKmsProviderFns = {
|
||||
validateConnection: () => Promise<boolean>;
|
||||
encrypt: (data: Buffer) => Promise<{ encryptedBlob: Buffer }>;
|
||||
decrypt: (encryptedBlob: Buffer) => Promise<{ data: Buffer }>;
|
||||
cleanup: () => Promise<boolean>;
|
||||
cleanup: () => Promise<void>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user