Add missing error handlers on stream pipelines

- AnonymizedFile.anonymizedContent(): propagate content errors to the
  anonymizer so callers see the failure instead of hanging.
- AnonymizedFile.send() local path: add error handler on the anonymizer
  transform between content and response pipes.
- S3.send(): handle errors on the S3 body stream to avoid unhandled
  emits crashing the process.
- S3.archive() / FileSystem.archive(): propagate read-stream errors
  to the file transformer so archiver sees the failure.
- Add frontend translations for new error codes.
This commit is contained in:
tdurieux committed 2026-05-07 07:47:29 +03:00
1 parent 7a163f2d35
commit 2de08c3df3
4 files changed
+22 -8

No files matched your search

+5 -3
View File
@@ -228,10 +228,12 @@ export default class FileSystem extends StorageBase {
await this.listFiles(repoId, dir, {
onEntry: async (file) => {
let rs = await this.read(repoId, file.path);
let rs: Readable = await this.read(repoId, file.path);
if (opt?.fileTransformer) {
// apply transformation on the stream
rs = rs.pipe(opt.fileTransformer(file.path));
const src = rs;
const transformer = opt.fileTransformer(file.path);
src.on("error", (err) => transformer.destroy(err));
rs = src.pipe(transformer);
}
const f = file.path.replace(fullPath, "");
archive.append(rs, {