The 'Disconnected' rejection just seems to occur when Espruino disconnects while trying to connect. It might be made worse by the fact it's trying to keep a connection to the PC going as well? All I can suggest is to do an automatic retry, which you could do by adding .catch(function(err) {...})
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The 'Disconnected' rejection just seems to occur when Espruino disconnects while trying to connect. It might be made worse by the fact it's trying to keep a connection to the PC going as well? All I can suggest is to do an automatic retry, which you could do by adding
.catch(function(err) {...})