mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-03 22:20:56 +00:00
fix(db): ignore errors during ref call
This commit is contained in:
1 parent
7752b7fc12
commit
56729ef9c1
2 files changed
+15
-11
No files matched your search
+12
-10
@@ -52,17 +52,19 @@ export const rawExecute = async (
|
|||||||
connection.release();
|
connection.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cb) {
|
try {
|
||||||
if (single) {
|
if (cb) {
|
||||||
if (type === null) {
|
if (single) {
|
||||||
//@ts-expect-error
|
if (type === null) {
|
||||||
if (response[0][0] && Object.keys(response[0][0]).length === 1) cb(Object.values(response[0][0])[0]);
|
//@ts-expect-error
|
||||||
else cb(response[0][0]);
|
if (response[0][0] && Object.keys(response[0][0]).length === 1) cb(Object.values(response[0][0])[0]);
|
||||||
|
else cb(response[0][0]);
|
||||||
|
} else {
|
||||||
|
cb(response[0]);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
cb(response[0]);
|
cb(response);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
cb(response);
|
|
||||||
}
|
}
|
||||||
}
|
} catch (err) {}
|
||||||
};
|
};
|
||||||
@@ -22,7 +22,9 @@ export const rawQuery = async (
|
|||||||
if (err) return reject(err);
|
if (err) return reject(err);
|
||||||
|
|
||||||
logQuery(invokingResource, query, executionTime, parameters);
|
logQuery(invokingResource, query, executionTime, parameters);
|
||||||
resolve(cb ? cb(parseResponse(type, result)) : null);
|
try {
|
||||||
|
resolve(cb ? cb(parseResponse(type, result)) : null);
|
||||||
|
} catch (err) {}
|
||||||
});
|
});
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
|||||||
Reference in new issue
Block a user