fix(evidence): report missing evidence files instead of permission advice
Reading a nonexistent Evidence bundle or snapshot, or exporting into a directory that does not exist, failed as reason "io" with "Evidence file could not be accessed. Check file permissions", and with no path. In `rea compare` the caller could not tell which of the two files failed. Map ENOENT and ENOTDIR to a new "missing" reason with read- and write-specific advice. Every EvidenceFileError now carries the resolved caller path in its projected details. Permission and other I/O failures keep the existing advice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
5547c1e697
commit
89252f1f35
@@ -259,7 +259,11 @@ const artifactStateErrorDetails = (
|
||||
};
|
||||
if (error instanceof UnknownRegistryError) return { reason: error.reason };
|
||||
if (error instanceof EvidenceFileError)
|
||||
return { operation: error.operation, reason: error.reason };
|
||||
return {
|
||||
operation: error.operation,
|
||||
reason: error.reason,
|
||||
...(error.path === undefined ? {} : { path: error.path }),
|
||||
};
|
||||
return undefined;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user