mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 22:22:50 +00:00
feature: Add event to error handling (#128)
This commit is contained in:
3 files changed
+24
-2
No files matched your search
@@ -77,6 +77,13 @@ export const rawExecute = async (
|
||||
.catch((err) => {
|
||||
const error = `${invokingResource} was unable to execute a query!\n${err}\n${`${query}`}`;
|
||||
|
||||
TriggerEvent('oxmysql:error', {
|
||||
query: query,
|
||||
parameters: parameters,
|
||||
message: err.message,
|
||||
err: err,
|
||||
});
|
||||
|
||||
if (cb && throwError) return cb(null, error);
|
||||
throw new Error(error);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user