https://github.com/thom311/libnl/blob/libnl3_2_25/lib/error.c#L84.
425618
def nl_syserr2nlerr(error_):
    """"""
    error_ = abs(error_)
    legend = {
        errno.EBADF: libnl.errno_.NLE_BAD_SOCK,
        errno.EADDRINUSE: libnl.errno_.NLE_EXIST,
        errno.EEXIST: libnl.errno_.NLE_EXIST,
        errno.EADDRNOTAVAIL: libnl.errno_.NLE_NOADDR,
        errno.ESRCH: libnl.errno_.NLE_OBJ_NOTFOUND,
        errno.ENOENT: libnl.errno_.NLE_OBJ_NOTFOUND,
        errno.EINTR: libnl.errno_.NLE_INTR,
        errno.EAGAIN: libnl.errno_.NLE_AGAIN,
        errno.ENOTSOCK: libnl.errno_.NLE_BAD_SOCK,
        errno.ENOPROTOOPT: libnl.errno_.NLE_INVAL,
        errno.EFAULT: libnl.errno_.NLE_INVAL,
        errno.EACCES: libnl.errno_.NLE_NOACCESS,
        errno.EINVAL: libnl.errno_.NLE_INVAL,
        errno.ENOBUFS: libnl.errno_.NLE_NOMEM,
        errno.ENOMEM: libnl.errno_.NLE_NOMEM,
        errno.EAFNOSUPPORT: libnl.errno_.NLE_AF_NOSUPPORT,
        errno.EPROTONOSUPPORT: libnl.errno_.NLE_PROTO_MISMATCH,
        errno.EOPNOTSUPP: libnl.errno_.NLE_OPNOTSUPP,
        errno.EPERM: libnl.errno_.NLE_PERM,
        errno.EBUSY: libnl.errno_.NLE_BUSY,
        errno.ERANGE: libnl.errno_.NLE_RANGE,
        errno.ENODEV: libnl.errno_.NLE_NODEV,
    }
    return int(legend.get(error_, libnl.errno_.NLE_FAILURE))
680609
def _node_errors(builder, env, tlist, slist):
    

    # First, figure out if there are any errors in the way the targets
    # were specified.
    for t in tlist:
        if t.side_effect:
            raise UserError("Multiple ways to build the same target were specified for: %s" % t)
        if t.has_explicit_builder():
            # Check for errors when the environments are different
            # No error if environments are the same Environment instance
            if (not t.env is None and not t.env is env and
                    # Check OverrideEnvironment case - no error if wrapped Environments
                    # are the same instance, and overrides lists match
                    not (getattr(t.env, '__subject', 0) is getattr(env, '__subject', 1) and
                         getattr(t.env, 'overrides', 0) == getattr(env, 'overrides', 1) and
                         not builder.multi)):
                action = t.builder.action
                t_contents = t.builder.action.get_contents(tlist, slist, t.env)
                contents = builder.action.get_contents(tlist, slist, env)

                if t_contents == contents:
                    msg = "Two different environments were specified for target %s,\n\tbut they appear to have the same action: %s" % (t, action.genstring(tlist, slist, t.env))
                    SCons.Warnings.warn(SCons.Warnings.DuplicateEnvironmentWarning, msg)
                else:
                    try:
                        msg = "Two environments with different actions were specified for the same target: %s\n(action 1: %s)\n(action 2: %s)" % (t,t_contents.decode('utf-8'),contents.decode('utf-8'))
                    except UnicodeDecodeError as e:
                        msg = "Two environments with different actions were specified for the same target: %s"%t
                    raise UserError(msg)
            if builder.multi:
                if t.builder != builder:
                    msg = "Two different builders (%s and %s) were specified for the same target: %s" % (t.builder.get_name(env), builder.get_name(env), t)
                    raise UserError(msg)
                # TODO(batch):  list constructed each time!
                if t.get_executor().get_all_targets() != tlist:
                    msg = "Two different target lists have a target in common: %s  (from %s and from %s)" % (t, list(map(str, t.get_executor().get_all_targets())), list(map(str, tlist)))
                    raise UserError(msg)
            elif t.sources != slist:
                msg = "Multiple ways to build the same target were specified for: %s  (from %s and from %s)" % (t, list(map(str, t.sources)), list(map(str, slist)))
                raise UserError(msg)

    if builder.single_source:
        if len(slist) > 1:
            raise UserError("More than one source given for single-source builder: targets=%s sources=%s" % (list(map(str,tlist)), list(map(str,slist))))
852021
function NabtoError(category, status, innerError) {
  var err = new Error();
  if (typeof(category) === "undefined") {
    throw new Error("Missing or invalid category");
  }
  this.initStatus(category, status, innerError);
  
  this.__defineGetter__('value', function() {
    return this.code;
  });

  this.__defineGetter__('message', function() {
    var msg = this.lookupMessage(this.code);
    if (!msg) {
      msg = 'Code ' + this.toString() + ' (' + this.code + ', Category ' + this.category + ', inner: ' + this.inner;
    }
    if (this.code == NabtoError.Code.P2P_INTERFACE_DEF_INVALID && this.inner.body) {
      msg = msg + ": " + this.inner.body;
    }
    return msg;
  });

}
68316
private Throwable loadLib(String _lib) {
        try {
            System.load(_lib);
            return null;
        } catch (Throwable _ex) {
            return _ex;
        }
    }
1197942
def _win32_strerror(err):
    

    # FormatMessage will allocate memory and assign it here
    buf = ctypes.c_char_p()
    FormatMessage(
        FORMAT_MESSAGE_FROM_SYSTEM
        | FORMAT_MESSAGE_ALLOCATE_BUFFER
        | FORMAT_MESSAGE_IGNORE_INSERTS,
        None,
        err,
        0,
        buf,
        0,
        None,
    )
    try:
        return buf.value
    finally:
        LocalFree(buf)
1273050
def error(self, msg, n):
        """"""
        raise SyntaxError(msg, n.lineno, n.col_offset,
                          filename=self.compile_info.filename)
1059456
static IllegalArgumentException error(String message, String str, int pos) {
    return new IllegalArgumentException(message + "\n" + context(str, pos));
  }
668089
function onError (data) {
    var map = sourceMap.map()
    var error
    var smc

    if (!data.length) {
      return
    }

    // if what we get isn't json, it's some other undescribed phantom error;
    // just echo it.
    try {
      error = JSON.parse(data.toString())
    } catch (e) {
      io.stderr.write(sprintf('\n\n%s\n', data.toString()))

      return
    }

    // if a source map wasn't present, just output the line numbers where an
    // error occurred
    if (!map) {
      io.stderr.write(sprintf('\n\n%s\n', error.message))

      if (error.trace && error.trace.length) {
        error.trace.forEach(function (e) {
          io.stderr.write(sprintf('    at :%d', e.line))

          if (e.function) {
            io.stderr.write(sprintf(' (in function %s)', e.function))
          }

          io.stderr.write('\n')
        })
      }

      return
    }

    // else, make sense of the sourcemap and output that information
    smc = new Consumer(map)

    io.stderr.write(sprintf('\n\n%s\n', error.message))

    if (error.trace && error.trace.length) {
      error.trace.forEach(function (e) {
        if (!e.line) {
          return
        }

        // phantom doesn't provide columns in stack traces
        var err = smc.originalPositionFor(
            {line: e.line, column: e.column || 0}
        )

        io.stderr.write(sprintf('    at %s:%d\n', err.source, err.line))
      })
    }
  }
18904
function createCompilerError(
  message: string,
  locations?: ?$ReadOnlyArray<Location>,
  nodes?: ?$ReadOnlyArray<ASTNode>,
): CompilerError {
  let messageWithLocations = message;
  if (locations != null) {
    const printedLocations = printLocations(locations);
    messageWithLocations =
      printedLocations.length === 0
        ? message
        : [message, ...printedLocations].join('\n\n') + '\n';
  }
  const error = new GraphQLError(
    `Internal Error: ${messageWithLocations}`,
    nodes ?? [],
  );
  return new Error(error.message);
}
1334066
function (dataChannel, info, err) {
        console.error(dataChannel.peerName + ": dataChannel(" +
                      dataChannel.dataChannel.label + "): error: ", err);
      }
515044
def web_err(i):

    

    http=i['http']
    tp=i['type']
    bin=i['bin']

    try: bin=bin.decode('utf-8')
    except Exception as e: pass

    if tp=='json':
       rx=ck.dumps_json({'dict':{'return':1, 'error':bin}})
       if rx['return']>0:
          bin2=rx['error'].encode('utf8')
       else:
          bin2=rx['string'].encode('utf-8')
    elif tp=='con':
       bin2=bin.encode('utf8')
    else:
       bin2=b'<html><body><pre>'+bin.encode('utf8')+b'</pre></body></html>'

    i['bin']=bin2
    return web_out(i)
112470
function L10nError (message, id, loc) {
        this.name = 'L10nError';
        this.message = message;
        this.id = id;
        this.loc = loc;
    }
1080353
def error(self, id, errorCode, errorString):
        ''''''
        if errorCode == 165: # Historical data sevice message
            sys.stderr.write("TWS INFO - %s: %s\n" % (errorCode, errorString))
        elif errorCode >= 501 and errorCode < 600: # Socket read failed
            sys.stderr.write("TWS CLIENT-ERROR - %s: %s\n" % (errorCode, errorString))
        elif errorCode >= 100 and errorCode < 1100:
            sys.stderr.write("TWS ERROR - %s: %s\n" % (errorCode, errorString))
        elif errorCode >= 1100 and errorCode < 2100:
            sys.stderr.write("TWS SYSTEM-ERROR - %s: %s\n" % (errorCode, errorString))
        elif errorCode in (2104, 2106, 2108):
            sys.stderr.write("TWS INFO - %s: %s\n" % (errorCode, errorString))
        elif errorCode >= 2100 and errorCode <= 2110:
            sys.stderr.write("TWS WARNING - %s: %s\n" % (errorCode, errorString))
        else:
            sys.stderr.write("TWS ERROR - %s: %s\n" % (errorCode, errorString))
336378
def _load_lib():
    """"""
    lib_path = find_lib_path()
    if len(lib_path) == 0:
        return None
    lib = ctypes.cdll.LoadLibrary(lib_path[0])
    lib.LGBM_GetLastError.restype = ctypes.c_char_p
    return lib
922597
function ErroneousError(e, additional) {
    additional = additional || {};
    this.line = e.lineno || e.lineNumber || additional.lineno;
    this.file = e.filename || e.fileName || additional.filename;
    this.msg = e.message || additional.message;
    this.time = e.timestamp || additional.timestamp || Date.now();
    this.type = (this.parseMessage(this.msg) || e.type || e.name).toLowerCase();

    // If it's a DOM node, let's figure out which
    if (e.target) {
      this.target = this.getTargetIdentifier(e.target);

      if (e.target.nodeName) {
        this.type = 'resource';
        if (e.target.href) {
          this.file = e.target.href;
        } else if (e.target.src) {
          this.file = e.target.src;
        }
      }
    }

    // Parse the stack if any
    this.stack = e.stack;
    this.parseStack(e.stack);
  }
45774
function _connectionError() {
  _connectionError = _asyncToGenerator(
  /*#__PURE__*/
  _regeneratorRuntime.mark(function _callee8(originalError) {
    var count, addObj, text, newError;
    return _regeneratorRuntime.wrap(function _callee8$(_context8) {
      while (1) {
        switch (_context8.prev = _context8.next) {
          case 0:
            _context8.next = 2;
            return countChannelFolders();

          case 2:
            count = _context8.sent;

            if (!(count < 30)) {
              _context8.next = 5;
              break;
            }

            return _context8.abrupt("return", originalError);

          case 5:
            addObj = {};
            Object.entries(originalError).forEach(function (_ref5) {
              var k = _ref5[0],
                  v = _ref5[1];
              return addObj[k] = v;
            });
            text = 'BroadcastChannel.create(): error: ' + 'This might happen if you have created to many channels, ' + 'like when you use BroadcastChannel in unit-tests.' + 'Try using BroadcastChannel.clearNodeFolder() to clear the tmp-folder before each test.' + 'See https://github.com/pubkey/broadcast-channel#clear-tmp-folder';
            newError = new Error(text + ': ' + JSON.stringify(addObj, null, 2));
            return _context8.abrupt("return", newError);

          case 10:
          case "end":
            return _context8.stop();
        }
      }
    }, _callee8);
  }));
  return _connectionError.apply(this, arguments);
}
575069
function onerror(meta, err) {
    const { ok, sourceFrame, atLine } = options.utils.getCodeInfo({
      parsedArgv: options.parsedArgv,
      filename: meta.filename,
      err,
    });

    if (ok) {
      console.error(options.ansi.bold.bgRed('  CRITICAL  '), atLine);
      console.error(sourceFrame);
    } else {
      console.error(options.ansi.bold.bgRed('  CRITICAL  '));
      console.error(options.ansi.red(err.stack));
    }
    console.error('');
  }