Examples of series()


Examples of org.springframework.http.HttpStatus.series()

   * if it is {@link org.springframework.http.HttpStatus.Series#SERVER_ERROR},
   * and a {@link RestClientException} in other cases.
   */
  public void handleError(ClientHttpResponse response) throws IOException {
    HttpStatus statusCode = getHttpStatusCode(response);
    switch (statusCode.series()) {
      case CLIENT_ERROR:
        throw new HttpClientErrorException(statusCode, response.getStatusText(),
            response.getHeaders(), getResponseBody(response), getCharset(response));
      case SERVER_ERROR:
        throw new HttpServerErrorException(statusCode, response.getStatusText(),
View Full Code Here

Examples of org.springframework.http.HttpStatus.series()

  public void handleError(ClientHttpResponse response) throws IOException {
    HttpStatus statusCode = response.getStatusCode();
    MediaType contentType = response.getHeaders().getContentType();
    Charset charset = contentType != null ? contentType.getCharSet() : null;
    byte[] body = getResponseBody(response);
    switch (statusCode.series()) {
      case CLIENT_ERROR:
        throw new HttpClientErrorException(statusCode, response.getStatusText(), body, charset);
      case SERVER_ERROR:
        throw new HttpServerErrorException(statusCode, response.getStatusText(), body, charset);
      default:
View Full Code Here

Examples of org.springframework.http.HttpStatus.series()

public class CloudControllerResponseErrorHandler extends DefaultResponseErrorHandler {
  @Override
  public void handleError(ClientHttpResponse response) throws IOException {
    HttpStatus statusCode = response.getStatusCode();
    switch (statusCode.series()) {
      case CLIENT_ERROR:
        throw getException(response);
      case SERVER_ERROR:
        throw new HttpServerErrorException(statusCode, response.getStatusText());
      default:
View Full Code Here

Examples of org.springframework.http.HttpStatus.series()

  }

  private HttpStatus.Series getHttpStatusSeries(MvcResult result) {
    int statusValue = result.getResponse().getStatus();
    HttpStatus status = HttpStatus.valueOf(statusValue);
    return status.series();
  }

  /**
   * Assert the Servlet response error message with the given Hamcrest {@link Matcher}.
   */
 
View Full Code Here

Examples of org.springframework.http.HttpStatus.series()

      delegate = new HttpMessageConverterExtractor<BddErrorMessage>(BddErrorMessage.class, messageConverters);
   }

   public boolean hasError(ClientHttpResponse response) throws IOException {
      HttpStatus statusCode = response.getStatusCode();
      if (statusCode.series() == Series.CLIENT_ERROR || statusCode.series() == Series.SERVER_ERROR) {
         return true;
      } else {
         return false;
      }
   }
View Full Code Here

Examples of org.springframework.http.HttpStatus.series()

      delegate = new HttpMessageConverterExtractor<BddErrorMessage>(BddErrorMessage.class, messageConverters);
   }

   public boolean hasError(ClientHttpResponse response) throws IOException {
      HttpStatus statusCode = response.getStatusCode();
      if (statusCode.series() == Series.CLIENT_ERROR || statusCode.series() == Series.SERVER_ERROR) {
         return true;
      } else {
         return false;
      }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.