try to fix e_channel_closed error

This commit is contained in:
Jan Prochazka
2023-09-30 12:29:28 +02:00
parent 731c4c046c
commit ce09fcb7fd
3 changed files with 22 additions and 3 deletions

View File

@@ -219,7 +219,16 @@ module.exports = {
if (!session) {
throw new Error('Invalid session');
}
session.subprocess.send({ msgtype: 'ping' });
try {
session.subprocess.send({ msgtype: 'ping' });
} catch (err) {
logger.error({ err }, 'Error pinging session');
return {
status: 'error',
message: 'Ping failed',
};
}
return { state: 'ok' };
},