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

+2
View File
@@ -269,6 +269,7 @@ export default class AnonymizedFile {
if (!config.STREAMER_ENTRYPOINT) {
// collect the content locally
const content = await this.content();
content.on("error", (err) => anonymizer.destroy(err));
return content.pipe(anonymizer);
}
@@ -412,6 +413,7 @@ export default class AnonymizedFile {
content
.on("error", handleStreamError)
.pipe(anonymizer)
.on("error", handleStreamError)
.pipe(res)
.on("error", handleStreamError)
.on("finish", () => {