fix(db/rawQuery): handle uncaught promise

oxmysql is unexpectedly catching errors thrown by the Lua runtime
when an error occurs during a function reference.
This lead to an 'undefined' error being thrown, specifically when
yielding a thread during the function reference.

Not really an oxmysql bug, so this should just be a temporary workaround.
This commit is contained in:
Linden committed 2022-06-24 14:14:37 +10:00
1 parent 655ee7309f
commit 5fc56caddf
1 file changed
+4
+4
View File
@@ -28,6 +28,10 @@ export const rawQuery = async (
} catch (err) {}
});
}).catch((err) => {
if (typeof err === 'string') {
return console.log(err)
}
const error = `${invokingResource} was unable to execute a query!\n${err.message}\n${`${query} ${JSON.stringify(parameters)}`}`;
TriggerEvent('oxmysql:error', {