Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
queryFailed: function queryFailed(report) {
// Parse the native query error into a normalized format
var parsedError;
try {
parsedError = MySQL.parseNativeQueryError({
nativeQueryError: report.error
}).execSync();
} catch (e) {
if (!options.disconnectOnError) {
return cb(e);
}
releaseConnection(options.connection, function releaseConnectionCb() {
return cb(e);
});
return;
}
// If the catch all error was used, return an error instance instead of
// the footprint.
var catchAllError = false;
queryFailed: function queryFailed(report) {
// Parse the native query error into a normalized format
var parsedError;
try {
parsedError = MySQL.parseNativeQueryError({
nativeQueryError: report.error
}).execSync();
} catch (e) {
return cb(e);
}
// If the catch all error was used, return an error instance instead of
// the footprint.
var catchAllError = false;
if (parsedError.footprint.identity === 'catchall') {
catchAllError = true;
}
if (catchAllError) {
return cb(report.error);