Examples of RestClientException


Examples of org.springframework.web.client.RestClientException

    final String[] status = new String[1];
    final HttpStatus[] httpStatus = new HttpStatus[1];
    final Object[] headers = new Object[1];
    final String[] message = new String[1];
    T results = null;
    RestClientException exception = null;
    try {
      results = super.doExecute(url, method, requestCallback,
          new ResponseExtractor<T>() {
            @SuppressWarnings("rawtypes")
            public T extractData(ClientHttpResponse response) throws IOException {
View Full Code Here

Examples of org.springframework.web.client.RestClientException

      case CLIENT_ERROR:
        throw getException(response);
      case SERVER_ERROR:
        throw new HttpServerErrorException(statusCode, response.getStatusText());
      default:
        throw new RestClientException("Unknown status code [" + statusCode + "]");
    }
  }
View Full Code Here

Examples of org.springframework.web.client.RestClientException

        assertThat(((GettingStartedGuide) model.get("guide")), is(guide));
    }

    @Test(expected = RestClientException.class)
    public void viewGuide_fails() {
        given(guides.find("rest-service")).willThrow(new RestClientException("Is GitHub down?"));
        controller.viewGuide("rest-service", model);
    }
View Full Code Here

Examples of org.springframework.web.client.RestClientException

    public <T> T execute(URI url, HttpMethod method, RequestCallback callback, ResponseExtractor<T> extractor) throws RestClientException {
      try {
        extractor.extractData(this.responses.remove());
      }
      catch (Throwable t) {
        throw new RestClientException("Failed to invoke extractor", t);
      }
      return null;
    }
View Full Code Here

Examples of org.teamcascade.java.brjc.api.RestClientException

      @Override
      public T apply(Response response) {
        try {
          final String body = response.getEntity();
          final Collection<ErrorCollection> errorMessages = extractErrors(response.getStatusCode(), body);
          throw new RestClientException(errorMessages, response.getStatusCode());
        } catch (JSONException e) {
          throw new RestClientException(e, response.getStatusCode());
        }
      }
    };
  }
View Full Code Here

Examples of org.teamcascade.java.brjc.api.RestClientException

      @Override
      public T apply(@Nullable Response input) {
        try {
          return responseHandler.handle(input);
        } catch (JSONException e) {
          throw new RestClientException(e);
        } catch (IOException e) {
          throw new RestClientException(e);
        }
      }
    };
  }
View Full Code Here

Examples of org.teamcascade.java.brjc.api.RestClientException

          public InputStream getInputStream() {
            try {
              return new ByteArrayInputStream(generator.generate(bean).toString().getBytes(Charset
                  .forName("UTF-8")));
            } catch (JSONException e) {
              throw new RestClientException(e);
            }
          }
        };
      }
    };
View Full Code Here

Examples of org.teamcascade.java.brjc.api.RestClientException

  public static URI parseURI(final String str) {
    try {
      return new URI(str);
    } catch (URISyntaxException e) {
      throw new RestClientException(e);
    }
  }
View Full Code Here

Examples of org.teamcascade.java.brjc.api.RestClientException

  public static DateTime parseDateTime(final String str) {
    try {
      return BAMBOO_DATE_TIME_FORMATTER.parseDateTime(str);
    } catch (Exception e) {
      throw new RestClientException(e);
    }
  }
View Full Code Here

Examples of org.teamcascade.java.brjc.api.RestClientException

      return BAMBOO_DATE_TIME_FORMATTER.parseDateTime(str);
    } catch (Exception ignored) {
      try {
        return BAMBOO_DATE_FORMATTER.parseDateTime(str);
      } catch (Exception e) {
        throw new RestClientException(e);
      }
    }
  }
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.