Spring Framework HttpClientErrorException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework HttpClientErrorException class.

This code example shows how to use the following methods:getStatusCode
		mCredentials.save(mApiKey, mEmail);
	} 
 
	@Override 
	protected void checkApiCallClientErrors(HttpClientErrorException e) throws RestServiceException {
		HttpStatus status = e.getStatusCode();
		if (status.value() == statusAuthFailed) {
			Log.e(getTag(), "authorization failed - email or password not valid");
            processException(RestServiceException.ERROR_AUTHORIZATION_ERROR, e, false);
		} else if (status.value() == statusOSMFailed) {
			Log.e(getTag(), "osm failed");
			processException(RestServiceException.ERROR_NOT_OSM_CONNECTED, e, false);
		} 
	} 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getMessage, getStatusText, getResponseBodyAsString
		if (error instanceof CloudFoundryException) {
			message = ((CloudFoundryException) error).getDescription();
		} 
 
		if (message == null) {
			message = error.getMessage();
			if (message == null) {
				message = error.getStatusText();
				if (message == null) {
					message = error.getResponseBodyAsString();
				} 
			} 
		} 
		return message;
	} 
 
	public static boolean isFileNotFoundForInstance(Exception e) {
		HttpClientErrorException badRequestException = getBadRequestException(e);
		if (badRequestException != null) {
			String message = getHttpErrorMessage(badRequestException);
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getMessage
   * wrapping an arbitrary HttpServerErrorException. 
   * 
   * @param cause the HttpServerErrorException thrown 
   */ 
  public CouchUsageException(HttpClientErrorException cause) {
    super(cause != null ? cause.getMessage() : null, cause);
  } 
 
} 
 
4
CodeRank
Experience pair programming with AI  Get Codota for Java