fix(process): clarify Windows capture support and recovery (#798)
This commit is contained in:
@@ -52,13 +52,19 @@ export class AnalysisOutputError extends AnalysisError {
|
||||
/** Selected provider cannot execute a declared analysis operation. */
|
||||
export class AnalysisCapabilityUnavailableError extends AnalysisError {
|
||||
readonly _tag = "AnalysisCapabilityUnavailableError";
|
||||
override readonly userMessage: string | undefined;
|
||||
|
||||
constructor(
|
||||
readonly providerId: string,
|
||||
readonly operation: string,
|
||||
readonly reason: string,
|
||||
options?: ErrorOptions & { readonly userMessage?: string },
|
||||
) {
|
||||
super(`Provider ${providerId} cannot execute ${operation}: ${reason}`);
|
||||
super(
|
||||
`Provider ${providerId} cannot execute ${operation}: ${reason}`,
|
||||
options,
|
||||
);
|
||||
this.userMessage = options?.userMessage;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -201,6 +201,8 @@ describe("analysis error projection: caller contract", () => {
|
||||
]);
|
||||
expect(projected[1]).toMatchObject({
|
||||
category: "unsupported_provider",
|
||||
message:
|
||||
"This analysis is unavailable for the current target. Choose another analysis or target.",
|
||||
details: {
|
||||
provider_id: "fixture",
|
||||
operation: "overview",
|
||||
@@ -213,6 +215,31 @@ describe("analysis error projection: caller contract", () => {
|
||||
expect(JSON.stringify(projected)).not.toContain("secret-token");
|
||||
});
|
||||
|
||||
it("uses explicit capability recovery while retaining the constraint", () => {
|
||||
const projected = projectAnalysisError(
|
||||
new AnalysisCapabilityUnavailableError(
|
||||
"fixture",
|
||||
"capture",
|
||||
"host constraint",
|
||||
{
|
||||
userMessage: "Use the supported host workflow.",
|
||||
cause: new Error("private internal cause"),
|
||||
},
|
||||
),
|
||||
);
|
||||
expect(projected).toMatchObject({
|
||||
code: "capability_unavailable",
|
||||
category: "unsupported_provider",
|
||||
message: "Use the supported host workflow.",
|
||||
details: {
|
||||
provider_id: "fixture",
|
||||
operation: "capture",
|
||||
reason: "host constraint",
|
||||
},
|
||||
});
|
||||
expect(JSON.stringify(projected)).not.toContain("private internal cause");
|
||||
});
|
||||
|
||||
it("preserves exact artifact-integrity coordinates", () => {
|
||||
expect(
|
||||
projectAnalysisError(
|
||||
|
||||
Reference in New Issue
Block a user