Java Code Examples for io.fabric8.kubernetes.api.model.Status#getMessage()

The following examples show how to use io.fabric8.kubernetes.api.model.Status#getMessage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OperationSupport.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
private String combineMessages(String customMessage, Status defaultStatus) {
  if (defaultStatus != null) {
    String message = defaultStatus.getMessage();
    if (message != null && message.length() > 0) {
      return customMessage + " " + message;
    }
  }
  return customMessage;
}
 
Example 2
Source File: OperationSupport.java    From kubernetes-client with Apache License 2.0 5 votes vote down vote up
public static KubernetesClientException requestFailure(Request request, Status status) {
  StringBuilder sb = new StringBuilder();
  sb.append("Failure executing: ").append(request.method())
    .append(" at: ").append(request.url().toString()).append(".");

  if (status.getMessage() != null && !status.getMessage().isEmpty()) {
    sb.append(" Message: ").append(status.getMessage()).append(".");
  }

  if (status != null && !status.getAdditionalProperties().containsKey(CLIENT_STATUS_FLAG)) {
    sb.append(" Received status: ").append(status).append(".");
  }

  return new KubernetesClientException(sb.toString(), status.getCode(), status);
}
 
Example 3
Source File: KubernetesClientException.java    From kubernetes-client with Apache License 2.0 4 votes vote down vote up
public KubernetesClientException(Status status) {
  this(status.getMessage(), status.getCode(), status);
}