UNPKG

@agent-base/secret-client

Version:
40 lines 1.25 kB
/** * Base error class for GoogleSecretManagerClient specific errors. */ export class GoogleSecretManagerError extends Error { constructor(message) { super(message); this.name = this.constructor.name; // Set the prototype explicitly to ensure instanceof works correctly Object.setPrototypeOf(this, new.target.prototype); } } /** * Error thrown when configuration for the GoogleSecretManagerClient is invalid. */ export class GoogleSecretManagerConfigError extends GoogleSecretManagerError { constructor(message) { super(message); } } /** * Error thrown when a secret is not found in Google Secret Manager. */ export class SecretNotFoundError extends GoogleSecretManagerError { secretId; constructor(secretId, message) { super(message || `Secret with ID '${secretId}' not found.`); this.secretId = secretId; } } /** * Error thrown for general issues when interacting with the Google Cloud Secret Manager API. */ export class GoogleCloudSecretManagerApiError extends GoogleSecretManagerError { originalError; constructor(message, originalError) { super(message); this.originalError = originalError; } } //# sourceMappingURL=errors.js.map