refactor(domain): split error taxonomy into thematic modules (#636)
Move each error family out of domain/errors.ts into its own module (base, core, provider selection/adapter, browser observation, artifact, evidence, unknown registry, hopper, configuration) and relocate AnalysisErrorProjection to analysisErrorProjection. Migrate all 162 importers to the owning modules and delete errors.ts. No re-export shims; behavior is unchanged.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import type { JsonValue } from "./jsonValue.js";
|
||||
import { AnalysisError } from "./analysisErrorBase.js";
|
||||
|
||||
/** A provider adapter failed outside its more precise typed variants. */
|
||||
export interface ProviderAdapterErrorOptions extends ErrorOptions {
|
||||
readonly diagnostics?: Readonly<Record<string, JsonValue>>;
|
||||
}
|
||||
|
||||
/** A provider adapter failed outside its more precise typed variants. */
|
||||
export class ProviderAdapterError extends AnalysisError {
|
||||
readonly _tag = "ProviderAdapterError";
|
||||
readonly diagnostics: Readonly<Record<string, JsonValue>> | undefined;
|
||||
|
||||
constructor(
|
||||
readonly providerId: string,
|
||||
readonly operation: string,
|
||||
options: ProviderAdapterErrorOptions = {},
|
||||
) {
|
||||
super(`Provider ${providerId} adapter failed during ${operation}`, options);
|
||||
this.diagnostics =
|
||||
options.diagnostics === undefined
|
||||
? undefined
|
||||
: structuredClone(options.diagnostics);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user