fix: fix error message when file is not found

This commit is contained in:
tdurieux
2022-10-19 10:38:44 +02:00
parent 3e2644438e
commit 8508a01c28
4 changed files with 12 additions and 5 deletions

View File

@@ -167,9 +167,8 @@ export default class AnonymizedFile {
}
if (await storage.exists(this.originalCachePath)) {
return storage.read(this.originalCachePath);
} else {
return await this.repository.source?.getFileContent(this);
}
return await this.repository.source?.getFileContent(this);
}
async anonymizedContent() {
@@ -192,8 +191,7 @@ export default class AnonymizedFile {
try {
await pipe(await this.anonymizedContent(), res);
} catch (error) {
handleError(error);
res.end();
handleError(error, res);
}
}
}