Skip to content

Commit 212f282

Browse files
authored
fix: redirect xml parser error to stream error (#1416)
1 parent 5f2dc07 commit 212f282

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/transformers.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ export function getConcater(parser, emitError) {
5252
}
5353
if (bufs.length) {
5454
if (parser) {
55-
this.push(parser(Buffer.concat(bufs).toString()))
55+
try {
56+
this.push(parser(Buffer.concat(bufs).toString()))
57+
} catch (e) {
58+
cb(e)
59+
return
60+
}
5661
} else {
5762
this.push(Buffer.concat(bufs))
5863
}

0 commit comments

Comments
 (0)