mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-10-20 14:47:18 +02:00
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:
4 files changed
+22
-8
No files matched your search
@@ -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, {
|
||||
|
||||
Reference in new issue
Block a user