From 5fc56caddf58e99774cb0177256019b3ab2aa596 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Fri, 24 Jun 2022 13:49:41 +1000 Subject: [PATCH] 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. --- src/database/rawQuery.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/database/rawQuery.ts b/src/database/rawQuery.ts index 471ec00..6c2bf47 100644 --- a/src/database/rawQuery.ts +++ b/src/database/rawQuery.ts @@ -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', {