Files
rea/src/domain/configurationErrors.ts
T
morluto 82626c4499 fix(hopper): bind file mappings to verified source bytes
Read source digests, FAT tables and embedded headers from one opened source stream before translating native offsets. Preserve native mapping observations through changed, missing, nonregular and access-denied source failures; keep filesystem work outside the Hopper API thread.

Exercise source drift, relocated slices, missing files, permissions and recovery through real Hopper CLI/MCP verification for thin, FAT32 and FAT64 inputs.
2026-10-09 06:13:41 +08:00

39 lines
1.2 KiB
TypeScript

import {
AnalysisError,
type AnalysisErrorOptions,
} from "./analysisErrorBase.js";
/** Runtime configuration could not be parsed safely. */
export class ConfigurationError extends AnalysisError {
readonly _tag = "ConfigurationError";
}
/** No app or binary session exists for an analysis request. */
export class NoBinaryOpenError extends AnalysisError {
readonly _tag = "NoBinaryOpenError";
constructor() {
super(
"No app is open. Ask the user which app to investigate, then call open_binary with its local path.",
);
}
}
/** Additional constraints identified while admitting a filesystem target. */
export interface BinaryTargetErrorOptions extends AnalysisErrorOptions {
readonly constraint?: "directory_requires_file";
}
/** A supplied target path could not be safely opened as a supported app or binary. */
export class BinaryTargetError extends AnalysisError {
readonly _tag = "BinaryTargetError";
readonly constraint: BinaryTargetErrorOptions["constraint"];
constructor(
readonly path: string,
readonly reason: string,
options?: BinaryTargetErrorOptions,
) {
super(`Cannot open artifact: ${reason}`, options);
this.constraint = options?.constraint;
}
}