feature: Add event to error handling (#128)

This commit is contained in:
Niek authored and GitHub committed 2022-06-22 02:32:22 +10:00
1 parent 15884fbc82
commit 655ee7309f
3 files changed
+24 -2

No files matched your search

+7
View File
@@ -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);
});