Package co.cask.cdap.client.exception

Examples of co.cask.cdap.client.exception.UnAuthorizedAccessTokenException


  private HttpResponse execute(HttpRequest request, int... allowedErrorCodes) throws IOException,
    UnAuthorizedAccessTokenException {
    HttpResponse response = HttpRequests.execute(request, defaultConfig);
    int responseCode = response.getResponseCode();
    if (responseCode == HttpURLConnection.HTTP_UNAUTHORIZED) {
      throw new UnAuthorizedAccessTokenException("Unauthorized status code received from the server.");
    } else if (!isSuccessful(responseCode) && !ArrayUtils.contains(allowedErrorCodes, responseCode)) {
      throw new IOException(responseCode + ": " + response.getResponseBodyAsString());
    }
    return response;
  }
View Full Code Here

TOP

Related Classes of co.cask.cdap.client.exception.UnAuthorizedAccessTokenException

Copyright © 2018 www.massapicom. 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.