gather-ts
Version:
A powerful code analysis and packaging tool designed for creating AI-friendly code representations for javascript and typescript projects.
90 lines (89 loc) • 3.13 kB
TypeScript
import { IBaseError, IErrorDetails, IFileSystemErrorDetails, ITokenizationErrorDetails, IValidationErrorDetails } from "@/types";
import { ICacheErrorDetails, ICompilationErrorDetails } from "../interfaces/error-types";
/**
* Base class for all gather-ts errors
*/
export declare abstract class GatherTSError extends Error implements IBaseError {
abstract readonly name: string;
readonly details?: IErrorDetails;
readonly timestamp: string;
constructor(message: string, details?: IErrorDetails);
toJSON(): {
name: string;
message: string;
details: IErrorDetails | undefined;
timestamp: string;
stack: string | undefined;
};
}
/**
* Input validation errors
*/
export declare class ValidationError extends GatherTSError {
readonly name = "ValidationError";
constructor(message: string, details?: IValidationErrorDetails);
}
/**
* File system operation errors
*/
export declare class FileSystemError extends GatherTSError {
readonly name = "FileSystemError";
constructor(message: string, filePath: string, operation: IFileSystemErrorDetails["operation"]);
get filePath(): string;
get operation(): IFileSystemErrorDetails["operation"];
}
/**
* Configuration related errors
*/
export declare class ConfigurationError extends GatherTSError {
readonly name = "ConfigurationError";
constructor(message: string, configPath: string);
}
/**
* Token processing errors
*/
export declare class TokenizationError extends GatherTSError {
readonly name = "TokenizationError";
constructor(message: string, filePath: string, operation: ITokenizationErrorDetails["operation"], model?: string);
get filePath(): string;
get operation(): ITokenizationErrorDetails["operation"];
}
/**
* Dependency analysis errors
*/
export declare class DependencyAnalysisError extends GatherTSError {
readonly name = "DependencyAnalysisError";
constructor(message: string, entryPoint?: string, failedDependencies?: string[]);
get entryPoint(): string | undefined;
get failedDependencies(): string[] | undefined;
}
/**
* Cache operation errors
*/
export declare class CacheError extends GatherTSError {
readonly name = "CacheError";
constructor(message: string, operation: ICacheErrorDetails["operation"], key?: string);
get operation(): ICacheErrorDetails["operation"];
}
/**
* Compilation process errors
*/
export declare class CompilationError extends GatherTSError {
readonly name = "CompilationError";
constructor(message: string, phase: ICompilationErrorDetails["phase"], details?: Omit<ICompilationErrorDetails, "phase">);
get phase(): ICompilationErrorDetails["phase"];
}
/**
* Timeout errors
*/
export declare class TimeoutError extends GatherTSError {
readonly name = "TimeoutError";
constructor(message: string, operation: string, timeout: number);
}
/**
* Resource usage limit errors
*/
export declare class ResourceLimitError extends GatherTSError {
readonly name = "ResourceLimitError";
constructor(message: string, resource: string, limit: number, actual: number);
}