fix(xo-server/callProxyMethod): destroy lines stream in case of error

This commit is contained in:
Julien Fontanet 2020-06-30 12:06:23 +02:00
parent e360f53a40
commit 98a1ab3033

View File

@ -367,6 +367,7 @@ export default class Proxy {
}
const isStream = result.$responseType === 'ndjson'
if (isStream !== expectStream) {
lines.destroy()
throw new Error(
`expect the result ${expectStream ? '' : 'not'} to be a stream`
)