@lineai/gov-deals
Version:
Explore Federal contracts for government building renovations, city hall renovations, courthouse updates, library modernizations, federal building improvement contracts, base housing and facilities upgrades.
71 lines (70 loc) • 2.26 kB
TypeScript
/**
* Custom error types for the gov-deals package
*/
/**
* Base error class for all gov-deals errors
*/
export declare class GovDealsError extends Error {
readonly code: string;
readonly details?: Record<string, unknown> | undefined;
constructor(message: string, code: string, details?: Record<string, unknown> | undefined);
}
/**
* Configuration error
*/
export declare class ConfigurationError extends GovDealsError {
constructor(message: string, details?: Record<string, unknown>);
}
/**
* Authentication error for API requests
*/
export declare class AuthenticationError extends GovDealsError {
constructor(message: string, details?: Record<string, unknown>);
}
/**
* API request error
*/
export declare class ApiError extends GovDealsError {
readonly statusCode?: number | undefined;
readonly response?: unknown;
constructor(message: string, statusCode?: number | undefined, response?: unknown, details?: Record<string, unknown>);
}
/**
* Rate limit error
*/
export declare class RateLimitError extends ApiError {
readonly retryAfter?: number | undefined;
constructor(message: string, retryAfter?: number | undefined, details?: Record<string, unknown>);
}
/**
* Validation error for data validation failures
*/
export declare class ValidationError extends GovDealsError {
readonly validationErrors?: unknown;
constructor(message: string, validationErrors?: unknown, details?: Record<string, unknown>);
}
/**
* Network error for connection issues
*/
export declare class NetworkError extends GovDealsError {
readonly originalError?: Error | undefined;
constructor(message: string, originalError?: Error | undefined, details?: Record<string, unknown>);
}
/**
* Timeout error
*/
export declare class TimeoutError extends NetworkError {
constructor(message: string, details?: Record<string, unknown>);
}
/**
* Check if an error is a gov-deals error
*/
export declare function isGovDealsError(error: unknown): error is GovDealsError;
/**
* Check if an error is a rate limit error
*/
export declare function isRateLimitError(error: unknown): error is RateLimitError;
/**
* Check if an error is retryable
*/
export declare function isRetryableError(error: unknown): boolean;