/**
 * Error thrown by Cloud Control API operations
 */
export class CloudControlError extends Error {
    message;
    response;
    constructor(message, response) {
        super(message);
        this.message = message;
        this.response = response;
    }
}
export class NetworkError extends CloudControlError {
}
export class RequestError extends CloudControlError {
    data;
    constructor(response, data) {
        super(response.statusText, response);
        this.data = data;
    }
}
export class UpdateFailedError extends CloudControlError {
    progressEvent;
    constructor(progressEvent) {
        super(progressEvent.StatusMessage);
        this.progressEvent = progressEvent;
    }
}
export class AlreadyExistsError extends CloudControlError {
    progressEvent;
    constructor(progressEvent) {
        super(progressEvent.StatusMessage);
        this.progressEvent = progressEvent;
    }
}
export class NotFoundError extends CloudControlError {
    progressEvent;
    constructor(progressEvent) {
        super(progressEvent.StatusMessage);
        this.progressEvent = progressEvent;
    }
}
export class ResourceNotFoundException extends CloudControlError {
    response;
    constructor(response) {
        super(response.statusText);
        this.response = response;
    }
}
export class TimeoutError extends CloudControlError {
}
/**
 * Rate limit exceeded error - should be retried with exponential backoff
 */
export class ThrottlingException extends CloudControlError {
    response;
    data;
    constructor(response, data) {
        super(data.message || "Rate exceeded", response);
        this.response = response;
        this.data = data;
    }
}
/**
 * Model validation failed error - indicates invalid resource properties
 */
export class ValidationException extends CloudControlError {
    response;
    data;
    constructor(response, data) {
        super(data.message || "Model validation failed", response);
        this.response = response;
        this.data = data;
    }
}
/**
 * A previous Cloud Control API request is still running for the same
 * resource. These are transient and should be retried after a short delay.
 */
export class ConcurrentOperationError extends CloudControlError {
    message;
    requestToken;
    /**
     * The request token of the in-flight operation from the AWS error message.
     * (e.g. "Concurrent operation found … with RequestToken 1234…")
     */
    constructor(message, requestToken) {
        super(message);
        this.message = message;
        this.requestToken = requestToken;
    }
}
//# sourceMappingURL=error.js.map