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:
parent
5f38e9b636
commit
26ee852336
1 changed files with 2 additions and 3 deletions
|
|
@ -90,11 +90,10 @@ async function fetchBare(url, res, req) {
|
||||||
request.body.pipe(res)
|
request.body.pipe(res)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
|
||||||
res.writeHead(500, 'Error', {
|
res.writeHead(500, 'Error', {
|
||||||
'content-type': 'application/javascript'
|
'content-type': 'application/javascript'
|
||||||
})
|
})
|
||||||
res.end(e);
|
res.end(e.stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -143,4 +142,4 @@ export {
|
||||||
route,
|
route,
|
||||||
routeSocket,
|
routeSocket,
|
||||||
isBare,
|
isBare,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue