:meth:`.WWebErrorPresenter.error_code` method implementation
557813
def error_code(self, code):
		
		return WWebResponse(
			status=code,
			headers=WHTTPHeaders(**{'Content-Type': 'text/plain; charset=utf-8'}),
			response_data=self.__message__(code).encode()
		)
1329576
def error_handler(_, event):
    # type: (Any, Any) -> int
    

    evt = event.contents
    ERROR.details = {
        "type": evt.type,
        "serial": evt.serial,
        "error_code": evt.error_code,
        "request_code": evt.request_code,
        "minor_code": evt.minor_code,
    }
    return 0
879448
def error(self, message, code=1):
        
        sys.stderr.write(message)
        sys.exit(code)
1339225
function decodeError(errorCode) {
    switch (errorCode) {
        case enums.ERROR_MODULE_NOT_EXIST:
            return { status: 404, error: enums.ERROR_MODULE_NOT_EXIST, message: 'This module does not exists.' };
        case enums.ERROR_MODULE_UNREACHABLE:
            return { status: 500, error: enums.ERROR_MODULE_UNREACHABLE, message: 'This module can not be reached.' };
        case enums.ERROR_MODULE_FORBIDDEN:
            return { status: 403, error: enums.ERROR_MODULE_FORBIDDEN, message: 'This module can not be accessed (forbidden).' };
    }
    return { status: 0, error: '', message: '' };
}
942377
def from_code(cls, code, **kw):
        
        return {
            TIMEOUT: TimeoutError,
            CANCELED: CanceledError,
            BUSY: BusyError,
            DECLINED: DeclinedError,
            UNEXPECTED_ERROR: UnexpectedError,
            BAD_REQUEST: BadRequestError,
            NETWORK_ERROR: NetworkError,
            UNHEALTHY: UnhealthyError,
            FATAL: FatalProtocolError,
        }[code](**kw)
1163367
private void handleErrorCode() {
		String msg = I18nUtilities
				.format(UIContextHolder.getCurrent().getLocale(),
						InternalMessages.DEFAULT_STEP_ERROR);
		throw new ErrorCodeEscape(HttpServletResponse.SC_BAD_REQUEST, msg);
	}
977390
def check(self, return_code=0):
        
        ret = self.call().return_code
        ok = ret == return_code
        if not ok:
            raise EasyProcessError(
                self, 'check error, return code is not {0}!'.format(return_code))
        return self
1170953
def _method_error_handler(self, response: Dict[str, Any]):
        
        exp = response.get('MESSAGE')
        code = response.get("CODE")
        ID = exp.get("ID")
        raise abort(code, ID=ID, message=exp.get('MESSAGE'))
537170
def handle_http_error(self, code, error):
        
        # 5xx code: error on server side
        if (code // 100) == 5:
            # ensure rollback if needed, else error page may
            # have an error, too, resulting in raw 500 page :-(
            db.session.rollback()

        template = f"error{code:d}.html"
        return render_template(template, error=error), code
525989
def _raise_error(self, status_code, raw_data):
        
        error_message = raw_data
        additional_info = None
        try:
            if raw_data:
                additional_info = json.loads(raw_data)
                error_message = additional_info.get('error', error_message)
                if isinstance(error_message, dict) and 'type' in error_message:
                    error_message = error_message['type']
        except (ValueError, TypeError) as err:
            logger.warning('Undecodable raw error response from server: %s', err)

        raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
1051256
def raise_error_if_failed!(result)
      return if result.status.statusCode == 0
      error_message = result.status.errorMessage || 'Execution failed!'
      raise RBHive::TCLIConnectionError.new(error_message)
    end
423339
def create_exception_by_error_code(
    errorCode,
    detailCode='0',
    description='',
    traceInformation=None,
    identifier=None,
    nodeId=None,
):
    
    try:
        dataone_exception = ERROR_CODE_TO_EXCEPTION_DICT[errorCode]
    except LookupError:
        dataone_exception = ServiceFailure
    return dataone_exception(
        detailCode, description, traceInformation, identifier, nodeId
    )
138619
private void onError(ErrorCode errorCode, String moreDetail) {
    startGoAway(0, errorCode, toGrpcStatus(errorCode).augmentDescription(moreDetail));
  }
186207
def api_exception(http_code):
    
    def wrapper(*args):
        code = args[0]
        ErrorMapping.mapping[http_code] = code
        return code
    return wrapper
718271
def error(self, status_code, request, message=None):
        
        status_code_text = HTTP_STATUS_CODES.get(status_code, 'http error')
        status_error_tag = status_code_text.lower().replace(' ', '_')
        custom_response_map = {
            404: self.make_error_response(
                status_error_tag,
                'The requested URL {} was not found on this service.'.format(
                    request.path
                )
            ),
            400: self.make_error_response(status_error_tag, message),
            405: self.make_error_response(
                status_error_tag,
                'The requested URL {} was not allowed HTTP method {}.'.format(
                    request.path, request.method
                )
            ),
        }
        return self._raw_response(
            status_code,
            custom_response_map.get(
                status_code,
                self.make_error_response(
                    status_error_tag, message or status_code_text
                )
            )
        )
1220666
function httpError($code, Swoole\Response $response, $content = '')
    {
        $response->setHttpStatus($code);
        $response->head['Content-Type'] = 'text/html';
        $response->body = Swoole\Error::info(Swoole\Response::$HTTP_HEADERS[$code],
            "<p>$content</p><hr><address>" . self::SOFTWARE . " at {$this->server->host}" .
            " Port {$this->server->port}</address>");
    }
799164
function HandleError($code, $line, $col, $byte_index = 0)
    {
        $sample_size = 80;
        $sample_start = $byte_index - ($sample_size / 2);
        if ($sample_start < 0) {
          $sample_start = 0;
        }
        
        trigger_error('XML Parsing Error at '.$line.':'.$col. (($byte_index != 0)?' (byte index: '.$byte_index.')':''). '. Error '.$code.': '.xml_error_string($code). ' check sample which starts at position '.$sample_start.': html encoded: '.htmlentities(substr($this->xml, $sample_start, $sample_size)). ' (hex: '.bin2hex(substr($this->xml, $sample_start, $sample_size)).', raw: '.(substr($this->xml, $sample_start, $sample_size)).')');
    }