Spring Framework HttpStatusCodeException - 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 HttpStatusCodeException 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
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getStatusCode, getStatusText
     *            the not client status code exception. 
     * @param message 
     *            the message to show if failed to created 
     */ 
    public static void propagateStatusCodeOnException(final HttpStatusCodeException ex, final String message) {
        if (ex.getStatusCode().value() == 409) {
            throw new ValidationException(ex.getStatusText());
        } 
 
        throw new IllegalStateException(message);
    } 
} 
4
CodeRank
Contextual code suggestions in your IDE  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
Contextual code suggestions in your IDE  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 DocumentExistsException(String documentId, HttpStatusCodeException cause) {
    super(cause != null ? cause.getMessage() : null, cause);
  } 
 
} 
 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Spring Framework HttpStatusCodeException Methods: