code: function isConnectivityError(err) {
      const code = err && typeof err.code === 'string' && err.code;
      const cls = code && code.substr(0, 2); // Error Class
      // istanbul ignore next (we cannot test-cover all error cases):
      return code === 'ECONNRESET' || cls === '08' || (cls === '57' && code !== '57014');
      // Code 'ECONNRESET' - Connectivity issue handled by the driver.
      // Class 08 - Connection Exception.
      // Class 57 - Operator Intervention (except for 57014, for cancelled queries).
      //
      // ERROR CODES: https://www.postgresql.org/docs/9.6/static/errcodes-appendix.html
  }
docs: /////////////////////////////////////////////////////////////////////////////////////// Identifies a general connectivity error, after which no more queries can be executed. This is primarily to detect when to skip executing ROLLBACK for a failed transaction.