ro.pippo.core.Response.internalError()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中ro.pippo.core.Response.internalError方法的一些代码示例,展示了Response.internalError的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.internalError方法的具体详情如下:
包路径:ro.pippo.core.Response
类名称:Response
方法名:internalError

Response.internalError介绍

[英]Set the response status to INTERNAL ERROR (500).

A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.
[中]将响应状态设置为内部错误(500)。
当遇到意外情况且没有更具体的消息时给出的一般错误消息。

代码示例

代码示例来源:origin: pippo-java/pippo

@Override
public void handle(RouteContext routeContext) {
  Response response = routeContext.getResponse().noCache().text();
  SortedMap<String, HealthCheck.Result> healthChecks = healthCheckRegistry.runHealthChecks();
  if (healthChecks.isEmpty()) {
    response.notImplemented().send("The health checks are empty");
  } else {
    boolean notHealthy = healthChecks.values().stream().anyMatch(hc -> !hc.isHealthy());
    if (notHealthy) {
      response.internalError().send("The health is bad");
    } else {
      response.ok().send("The health is good");
    }
  }
}

代码示例来源:origin: pippo-java/pippo

@Override
public void handle(RouteContext routeContext) {
  Response response = routeContext.getResponse().noCache().text();
  if (threadDump != null) {
    threadDump.dump(response.getOutputStream());
  } else {
    response.internalError().send("Sorry your runtime environment does not allow to dump threads");
  }
}

代码示例来源:origin: ro.pippo/pippo-metrics

@Override
public void handle(RouteContext routeContext) {
  Response response = routeContext.getResponse().noCache().text();
  SortedMap<String, HealthCheck.Result> healthChecks = healthCheckRegistry.runHealthChecks();
  if (healthChecks.isEmpty()) {
    response.notImplemented().send("The health checks are empty");
  } else {
    boolean notHealthy = healthChecks.values().stream().anyMatch(hc -> !hc.isHealthy());
    if (notHealthy) {
      response.internalError().send("The health is bad");
    } else {
      response.ok().send("The health is good");
    }
  }
}

代码示例来源:origin: ro.pippo/pippo-metrics

@Override
public void handle(RouteContext routeContext) {
  Response response = routeContext.getResponse().noCache().text();
  if (threadDump != null) {
    threadDump.dump(response.getOutputStream());
  } else {
    response.internalError().send("Sorry your runtime environment does not allow to dump threads");
  }
}

代码示例来源:origin: com.gitblit.fathom/fathom-xmlrpc

context.getResponse().internalError().commit();

代码示例来源:origin: gitblit/fathom

context.getResponse().internalError().commit();

相关文章