@cloud-copilot/iam-collect
Version:
Collect IAM information from AWS Accounts
24 lines • 1.3 kB
TypeScript
/**
*
* @param operation The operation to run.
* @returns If successful, returns the result of operation. If operation returns a 404, returns undefined.
* @throws If operation returns a non 404 error, rethrows that error.
*/
export declare function runAndCatch404<T>(operation: () => Promise<T | undefined>): Promise<T | undefined>;
/**
*
* @param operation The operation to run.
* @returns If successful, returns the result of operation. If operation returns a 404, returns undefined.
* @throws If operation returns a non 400 error, rethrows that error.
*/
export declare function runAndCatchAccessDenied<T>(operation: () => Promise<T | undefined>): Promise<T | undefined>;
/**
* Run an operation and catch a specific error by name. Return undefined if the error matches, otherwise rethrow the error.
*
* @param errorName the name of the error to catch
* @param operation the operation to run
* @returns If successful, returns the result of operation. If operation throws an error with the specified name, returns undefined.
* @throws If operation throws an error with a different name, rethrows that error.
*/
export declare function runAndCatchError<T>(errorName: string, operation: () => Promise<T | undefined>): Promise<T | undefined>;
//# sourceMappingURL=client-tools.d.ts.map