midi: display an error when the midi bridge process crashes and prevent further errors when attempting to send messages
This commit is contained in:
parent
524b6e74ec
commit
8ddee033eb
2 changed files with 12 additions and 1 deletions
|
|
@ -43,10 +43,18 @@ class MidiConverter {
|
|||
}
|
||||
})
|
||||
|
||||
this.running = true
|
||||
this.py.childProcess.on('exit', (code)=>{
|
||||
if (code === null) console.error(`(ERROR, MIDI) Midi bridge process crashed`)
|
||||
this.running = false
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
send(data) {
|
||||
|
||||
if (!this.running) return
|
||||
|
||||
var args = []
|
||||
for (let i in data.args) {
|
||||
args.push(data.args[i].value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue