fix(audit): clarify missing drift artifacts-dir errors
Replace raw ENOENT from drift artifact directory scans with a clear explicit error message containing the resolved path. Architecture/protocol diagrams reviewed; no updates needed.
This commit is contained in:
@@ -209,7 +209,15 @@ function buildThresholds(values: Record<string, string | boolean | undefined>):
|
||||
}
|
||||
|
||||
async function readArtifactRecords(artifactsDir: string): Promise<ArtifactRecord[]> {
|
||||
const files = await readdir(artifactsDir);
|
||||
let files: string[];
|
||||
try {
|
||||
files = await readdir(artifactsDir);
|
||||
} catch (error) {
|
||||
if ((error as NodeJS.ErrnoException)?.code === 'ENOENT') {
|
||||
throw new Error(`Artifacts directory does not exist: ${artifactsDir}`);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
const records: ArtifactRecord[] = [];
|
||||
|
||||
for (const file of files) {
|
||||
|
||||
Reference in New Issue
Block a user