mirror of
https://github.com/morluto/rea.git
synced 2026-11-11 09:21:16 +00:00
49 lines
1.5 KiB
TypeScript
49 lines
1.5 KiB
TypeScript
import {
|
|
AnalysisError,
|
|
type AnalysisErrorOptions,
|
|
} from "./analysisErrorBase.js";
|
|
|
|
/** Artifact inventory or extraction failed a typed safety boundary. */
|
|
export class ArtifactOperationError extends AnalysisError {
|
|
readonly _tag = "ArtifactOperationError";
|
|
|
|
constructor(
|
|
readonly operation:
|
|
| "inventory_artifact"
|
|
| "inspect_artifact"
|
|
| "extract_artifact"
|
|
| "decode_interface_builder"
|
|
| "inspect_asset_catalog"
|
|
| "inspect_keyed_archive"
|
|
| "trace_dylib_resolution"
|
|
| "export_web_scripts"
|
|
| "trace_web_module_imports"
|
|
| "trace_web_source_location"
|
|
| "analyze_javascript_application",
|
|
readonly reason:
|
|
| "cancelled"
|
|
| "format"
|
|
| "integrity"
|
|
| "limit"
|
|
| "path"
|
|
| "unavailable"
|
|
| "io",
|
|
readonly artifactDetails?: Readonly<{
|
|
logicalPath: string;
|
|
declaredSha256: string | null;
|
|
calculatedSha256: string | null;
|
|
unpacked: boolean;
|
|
}>,
|
|
/** The specific constraint that failed, such as the colliding path. */
|
|
readonly detail?: string,
|
|
options?: AnalysisErrorOptions,
|
|
) {
|
|
super(
|
|
artifactDetails === undefined
|
|
? `Artifact ${operation} failed: ${reason}`
|
|
: `Artifact ${operation} failed: ${reason} at ${artifactDetails.logicalPath} (declared_sha256=${artifactDetails.declaredSha256 ?? "unavailable"}, calculated_sha256=${artifactDetails.calculatedSha256 ?? "unavailable"}, unpacked=${String(artifactDetails.unpacked)})`,
|
|
options,
|
|
);
|
|
}
|
|
}
|