In this problem, the database queries work, however, every time I throw an error inside the query, the entire program crashes. I tried many different tweaks to the code to get around this, but none of them worked.Also, even with await, the queries do not follow synchronously. I couldn't fix this either.exports.run = async (client, msg, args) => { try { await client.db.all(client.exist, args[1], (err, rows) => { if (rows.length > 0) { throw `Exists`; } }); await client.db.all(client.count, [], (err, rows) => { if (rows.length > 64) { throw 'Full'; } }); console.log('Worked'); } catch (e) { return console.log(err); } }; Is there a work around to this error? Regards.
Submitted July 05, 2020 at 06:55AM by CryptoPM
No comments:
Post a Comment