Skip to content

Commit

Permalink
add more error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveMieskoski committed Apr 1, 2021
1 parent ec1d66d commit bff9626
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/connectClient/WebRtcCommunication.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ export default class WebRtcCommunication extends MewConnectCommon {

isAlive() {
if (this.p !== null) {
return this.p._connected && !this.p.destroyed;
if(this.p._connected && !this.p.destroyed){
return true;
}
return ;
}
return false;
}
Expand Down Expand Up @@ -457,6 +460,7 @@ export default class WebRtcCommunication extends MewConnectCommon {
`[WebRTC Comm - SEND RTC MESSAGE] type: ${type}, message: ${msg}, id: ${id}`
);
this.rtcSend(JSON.stringify({ type, data: msg, id })).catch(err => {
logger.error(err)
debug(err);
});
}
Expand All @@ -481,6 +485,7 @@ export default class WebRtcCommunication extends MewConnectCommon {
this.instance = null;
}
} catch (e) {
logger.error(e)
debug(e);
}
}
Expand All @@ -501,9 +506,11 @@ export default class WebRtcCommunication extends MewConnectCommon {
} else {
// eslint-disable-next-line
this.uiCommunicator(this.lifeCycle.attemptedDisconnectedSend);
logger.error(Error('No connection present to send'))
return false;
}
} catch (e) {
logger.error(e)
debug(e);
}
}
Expand All @@ -519,8 +526,7 @@ export default class WebRtcCommunication extends MewConnectCommon {
try {
this.p.destroy();
} catch (e) {
// eslint-disable-next-line
console.error(e);
logger.error(e)
}
}
}
Expand Down

0 comments on commit bff9626

Please sign in to comment.