Fix error reporting in Cyclone custom bare

console.log(e) is a bad idea in general. Moreover, errors cannot be
written to streams, since they are neither strings nor Buffers.
This commit is contained in:
CountBleck 2022-08-27 20:02:17 -07:00 committed by GitHub
parent 5f38e9b636
commit 26ee852336
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -90,11 +90,10 @@ async function fetchBare(url, res, req) {
request.body.pipe(res)
}
} catch (e) {
console.log(e);
res.writeHead(500, 'Error', {
'content-type': 'application/javascript'
})
res.end(e);
res.end(e.stack);
}
}