import { CodeBuddyError } from './base-error.js';
/**
 * API request failed
 */
export class ApiError extends CodeBuddyError {
    statusCode;
    endpoint;
    constructor(message, options = {}) {
        super('API_ERROR', message, options);
        this.name = 'ApiError';
        this.statusCode = options.statusCode;
        this.endpoint = options.endpoint;
    }
}
/**
 * API rate limit exceeded
 */
export class RateLimitError extends ApiError {
    retryAfter;
    constructor(retryAfter) {
        super('Rate limit exceeded', { statusCode: 429 });
        this.name = 'RateLimitError';
        Object.defineProperty(this, 'code', { value: 'RATE_LIMIT_EXCEEDED', writable: false });
        this.retryAfter = retryAfter;
    }
}
/**
 * API authentication failed
 */
export class AuthenticationError extends ApiError {
    constructor(message = 'Authentication failed') {
        super(message, { statusCode: 401 });
        this.name = 'AuthenticationError';
        Object.defineProperty(this, 'code', { value: 'AUTHENTICATION_FAILED', writable: false });
    }
}
//# sourceMappingURL=provider-error.js.map