I noticed that executing app.db.getTracklist with an invalid query throws an exception which leaves mediamonkey unresponsive and I couldn't find a way to handle these errors.
Basically, what I'm trying to do is opening the console and running the following code
Code: Select all
app.db.getTracklist('SELECT * FROM SONGS', -1).whenLoaded().then(function () {
console.log('ok')
}).catch((err) => {
console.log(err)
})
getQueryResultAsync behaves slightly different:
Code: Select all
app.db.getQueryResultAsync('SELECT * FROM SONGS').then(function (result) {
console.log('ok')
}).catch((err) => {
console.log(err)
})
Does anybody know how I can prevent getTracklist from crashing mediamonkey or, even better, a method to handle these kind of exceptions before the users sees them?