How to use the machinepack-mysql.parseNativeQueryError function in machinepack-mysql

To help you get started, we’ve selected a few machinepack-mysql examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github balderdashy / sails-mysql / helpers / private / query / run-query.js View on Github external
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;
github balderdashy / sails-mysql / helpers / private / query / run-native-query.js View on Github external
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);