catch socket connection error
This commit is contained in:
parent
b1b3be5e22
commit
836faee834
@ -2,7 +2,7 @@
|
||||
"main": "plugin.js",
|
||||
"name": "syncplay",
|
||||
"description": "Syncplay Service for Squeebot 3",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"tags": ["service", "syncplay"],
|
||||
"dependencies": ["control?"],
|
||||
"npmDependencies": []
|
||||
|
@ -196,6 +196,7 @@ class SyncplayProtocol extends Protocol {
|
||||
password = crypto.createHash('md5').update(password).digest('hex');
|
||||
}
|
||||
|
||||
try {
|
||||
this.socket = net.connect(opts, () => {
|
||||
this.write({
|
||||
Hello: {
|
||||
@ -206,6 +207,11 @@ class SyncplayProtocol extends Protocol {
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch(err: any) {
|
||||
this.emit('error', err);
|
||||
this.stop(true);
|
||||
return;
|
||||
}
|
||||
|
||||
let buffer: any = '';
|
||||
this.socket.on('data', (chunk) => {
|
||||
|
Loading…
Reference in New Issue
Block a user