Skip to content

Commit

Permalink
fix: catch ws errors
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtIeSocks authored and Fabio1988 committed Nov 13, 2024
1 parent 11278cd commit b5017d6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ process
process.exit();
});

wssDevice.on('error', (err) => {
log.error(`Device: ${err}`);
});

wssDevice.on('connection', (ws, req) => {
if (config.deviceListener.secret) {
if (config.deviceListener.secret != req.headers['x-rotom-secret']) {
Expand Down Expand Up @@ -224,6 +228,10 @@ function identifyControlChannelFromWorkerId(workerId: string): string | null {
return null;
}

wssController.on('error', (err) => {
log.error(`CONTROLLER: ${err}`);
});

wssController.on('connection', (ws, req) => {
if (config.controllerListener.secret) {
if (config.controllerListener.secret != req.headers['x-rotom-secret']) {
Expand Down

0 comments on commit b5017d6

Please sign in to comment.