mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-03 06:28:53 +00:00
refactor: error handling
Meant to push this before release. Ensures errors are handled as before, regardless of using exports or lib/mysql; for compatibility.
This commit is contained in:
1 parent
a709f67e99
commit
15884fbc82
4 files changed
+7
-7
No files matched your search
@@ -30,7 +30,7 @@ export const rawQuery = async (
|
||||
}).catch((err) => {
|
||||
const error = `${invokingResource} was unable to execute a query!\n${err.message}\n${`${query} ${JSON.stringify(parameters)}`}`
|
||||
|
||||
if (cb && !throwError) cb(null, error);
|
||||
if (throwError || !cb) throw new Error(error);
|
||||
if (cb && throwError) return cb(null, error);
|
||||
throw new Error(error);
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user