mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 14:38:50 +00:00
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:
1 parent
655ee7309f
commit
5fc56caddf
1 file changed
+4
@@ -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', {
|
||||
|
||||
Reference in new issue
Block a user