Improve debug output in WebSocket error guard
This commit is contained in:
parent
844bc3457d
commit
9d12ef311c
|
@ -209,17 +209,17 @@ function _server(host, port, httpsOptions) {
|
||||||
|
|
||||||
react {
|
react {
|
||||||
const facet = currentFacet();
|
const facet = currentFacet();
|
||||||
|
const id = genUuid('_wsRequest');
|
||||||
const guard = (f) => {
|
const guard = (f) => {
|
||||||
try {
|
try {
|
||||||
f()
|
f()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Swallow e, which will be some kind of websocket-related exception.
|
// Swallow e, which will be some kind of websocket-related exception.
|
||||||
console.debug('WebSocket exception in actor '+facet.actor.toString(), e);
|
console.debug('WebSocket '+id+' exception in actor '+facet.actor.toString(), e);
|
||||||
facet.stop();
|
facet.stop();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let id = genUuid('_wsRequest');
|
|
||||||
assert WebSocket(id, server, pieces, url.query);
|
assert WebSocket(id, server, pieces, url.query);
|
||||||
|
|
||||||
on stop guard(() => ws.close());
|
on stop guard(() => ws.close());
|
||||||
|
|
Loading…
Reference in New Issue