UNPKG

gather-ts

Version:

A powerful code analysis and packaging tool designed for creating AI-friendly code representations for javascript and typescript projects.

21 lines (20 loc) 835 B
import { ILogger } from "@/utils"; import { IService } from "@/types/services"; import { IErrorClassification, IErrorTransformation } from "./IError"; import { IBaseError, IErrorDetails } from "@/types"; export interface IErrorUtilsDeps { logger: ILogger; } export interface IErrorUtilsOptions { debug?: boolean; } export interface IErrorUtils extends IService { isGatherTSError(error: unknown): error is IBaseError; wrapError(error: unknown, context: string): Error; formatErrorDetails(details: IErrorDetails): string; aggregateErrors(errors: Error[]): Error; classifyError(error: unknown): IErrorClassification; transformError(error: unknown, transformations: IErrorTransformation[]): Error; extractErrorContext(error: Error): Record<string, unknown>; normalizeError(error: unknown): Error; }