Return to user only headers with an error as part of a header
178372
protected function showHTTP($exception) {
		header("HTTP/1.1 400 Unexpected error");
		$message = preg_replace('![^a-z 0-9_-]!','',$this->getMessageForUser($exception));
		header("X-Error-Message: ".$message);
	}
335700
def error(self, msgid, error):
        """"""
        self.requests[msgid].errback(error)
        del self.requests[msgid]
975448
private function error($header) {
        list($status, $stash) = explode("\r\n", $header, 2);
        list($v, $code, $message) = explode(" ", $status, 3);
        $message = is_null($message) ? 'File Not Found' : "[{$status}]:{$message}";
        $this->error = $message;
    }
960263
def as_error(self) :
        ""
        result = dbus.Error.init()
        result.set(self.args[0], self.args[1])
        return \
            result
641366
def request_error_header(exception):
    

    from .conf import options
    
    header = "Bearer realm=\"%s\"" % (options.realm, )
    
    if hasattr(exception, "error"):
        header = header + ", error=\"%s\"" % (exception.error, )
    
    if hasattr(exception, "reason"):
        header = header + ", error_description=\"%s\"" % (exception.reason, )
    
    return header
794200
def _make_error(index, code, errmsg, operation):
    
    return {
        _UINDEX: index,
        _UCODE: code,
        _UERRMSG: errmsg,
        _UOP: operation
    }
43556
def get_headers(hide_env=True):
    """"""

    headers = dict(request.headers.items())

    if hide_env and ('show_env' not in request.args):
        for key in ENV_HEADERS:
            try:
                del headers[key]
            except KeyError:
                pass

    return CaseInsensitiveDict(headers.items())
413711
function onError(error) {
    if (error.syscall !== 'listen') throw error;

    const bind = (typeof port === 'string')
                ? 'Pipe ' + port
                : 'Port ' + port;

    // handle specific listen errors with friendly messages
    switch (error.code) {
      case 'EACCES':
        console.error(bind + ' requires elevated privileges');
        process.exit(1);
        break;

      case 'EADDRINUSE':
        console.error(bind + ' is already in use');
        process.exit(1);
        break;

      default:
        throw error;
    }
  }
638403
function error (out, desc) {
  logger.error(header())
  if (desc) {
    logger.error(desc)
  }
  logger.error(out)
  logger.error()
}
163114
def get_headers(server):
    """"""
    try:
        response = requests.head(
            server, allow_redirects=False, verify=False, timeout=5)
    except requests.exceptions.ConnectionError:
        return False

    return dict(response.headers)
1023274
function serializeError(err) {
  var o = {};

  Object.getOwnPropertyNames(err).forEach(function (k) {
    o[k] = err[k];
  });

  return _.omit(o, ['stack', 'type', 'arguments']);
}
691742
def errors(self,
               errors: List[str],
               code: Union[int, Tuple[int, str, str]] = HTTPStatus.BAD_REQUEST,
               key: str = 'errors',
               headers: Optional[Dict[str, str]] = None,
               ):
        
        return jsonify({key: errors}), code, headers or {}
412203
def filter_304_headers(headers):
    """"""
    return [(k, v) for k, v in headers if k.lower() not in _filter_from_304]
216230
function(_headers,_key,_default){
            var _value = _headers[_key]||
                         _headers[_key.toLowerCase()];
            if (!_value){
                _value = _default;
                _headers[_key] = _value;
            }
            return _value;
        }
319128
def error(request, message, extra_tags='', fail_silently=False, async=False):
    """"""
    if ASYNC and async:
        messages.debug(_get_user(request), message)
    else:
        add_message(request, constants.ERROR, message, extra_tags=extra_tags,
                    fail_silently=fail_silently)
546248
def allow_cors(func):
    """"""
    def wrapper(*args, **kwargs):
        response.headers['Access-Control-Allow-Origin'] = '*'
        response.headers['Access-Control-Allow-Methods'] = \
            'PUT, GET, POST, DELETE, OPTIONS'
        response.headers['Access-Control-Allow-Headers'] = \
            'Origin, Accept, Content-Type, X-Requested-With, X-CSRF-Token'
        return func(*args, **kwargs)
    return wrapper
692840
def http_error_default(self, url, fp, errcode, errmsg, headers):
        """"""
        return addinfourl(fp, headers, "http:" + url, errcode)