Log socket close error if any
This commit is contained in:
parent
22b02dff31
commit
1b97c1031d
@ -78,7 +78,7 @@ module.exports = function(irc, network) {
|
||||
identSocketId = client.manager.identHandler.addSocket(socket, client.name || network.username);
|
||||
});
|
||||
|
||||
irc.on("socket close", function() {
|
||||
irc.on("socket close", function(error) {
|
||||
if (identSocketId > 0) {
|
||||
client.manager.identHandler.removeSocket(identSocketId);
|
||||
identSocketId = 0;
|
||||
@ -88,6 +88,13 @@ module.exports = function(irc, network) {
|
||||
chan.state = Chan.State.PARTED;
|
||||
});
|
||||
|
||||
if (error) {
|
||||
network.channels[0].pushMessage(client, new Msg({
|
||||
type: Msg.Type.ERROR,
|
||||
text: `Connection closed unexpectedly: ${error}`,
|
||||
}), true);
|
||||
}
|
||||
|
||||
sendStatus();
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user