Java Code Examples for com.amazonaws.http.HttpResponse#getStatusText()

The following examples show how to use com.amazonaws.http.HttpResponse#getStatusText() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ErrorResponseHandler.java    From getting-started with MIT License 5 votes vote down vote up
@Override
public AmazonServiceException handle(final HttpResponse response) {
  final AmazonServiceException ase = new AmazonServiceException(response.getStatusText());
  ase.setStatusCode(response.getStatusCode());
  try {
    final String content = IOUtils.toString(response.getContent()).trim();
    ase.setRawResponseContent(content);
  } catch (IOException exception) {
    System.err.println("Exception thrown while reading the response's content: " + exception);
  }

  return ase;
}
 
Example 2
Source File: SimpleAwsErrorHandler.java    From charles-rest with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public AmazonServiceException handle(HttpResponse response) {
    AmazonServiceException ase = new AmazonServiceException(response.getStatusText());
    ase.setStatusCode(response.getStatusCode());
    return ase;
}