midi: prevent the main process from exiting when MIDI setup fails and use stderr when appropriate (#218)
This commit is contained in:
parent
04b985705e
commit
565ab78064
3 changed files with 13 additions and 5 deletions
|
|
@ -31,13 +31,16 @@ init = (receiveOsc)=>{
|
|||
// console.log(err)
|
||||
}
|
||||
if (name == 'log') {
|
||||
console.log(data)
|
||||
if (data.indexOf('ERROR') === 0) {
|
||||
console.error(data)
|
||||
} else {
|
||||
console.log(data)
|
||||
}
|
||||
} else if (name == 'osc') {
|
||||
receiveOsc(data)
|
||||
} else if (name == 'error') {
|
||||
console.log('ERROR: Midi: ' + data)
|
||||
console.error('ERROR: MIDI: ' + data)
|
||||
stop()
|
||||
process.exit()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue