public final class ErrorTranslation extends Object
translateException
and nearby; that has grown to be
a large a complex piece of logic, as it ties in with retry/recovery
policies, throttling, etc.
This class is where future expansion of that code should go so that we have
an isolated place for all the changes..
The existing code las been left in S3AUtils it is to avoid cherry-picking
problems on backports.Modifier and Type | Class and Description |
---|---|
static class |
ErrorTranslation.AwsErrorCodes
AWS error codes explicitly recognized and processes specially;
kept in their own class for isolation.
|
Modifier and Type | Field and Description |
---|---|
static String |
OPENSSL_STREAM_CLOSED
OpenSSL stream closed error: "WFOPENSSL0035".
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isObjectNotFound(software.amazon.awssdk.awscore.exception.AwsServiceException e)
Does this exception indicate that a reference to an object
returned a 404.
|
static boolean |
isUnknownBucket(software.amazon.awssdk.awscore.exception.AwsServiceException e)
Does this exception indicate that the AWS Bucket was unknown.
|
static HttpChannelEOFException |
maybeExtractChannelException(String path,
String message,
Throwable thrown)
Extract an AWS HTTP channel exception if the inner exception is considered
an HttpClient
NoHttpResponseException or an OpenSSL channel exception. |
static IOException |
maybeExtractIOException(String path,
Throwable thrown,
String message)
Translate an exception if it or its inner exception is an
IOException.
|
public static final String OPENSSL_STREAM_CLOSED
public static boolean isUnknownBucket(software.amazon.awssdk.awscore.exception.AwsServiceException e)
e
- exception.public static boolean isObjectNotFound(software.amazon.awssdk.awscore.exception.AwsServiceException e)
e
- exception.public static IOException maybeExtractIOException(String path, Throwable thrown, String message)
path
- path of operation.thrown
- exceptionmessage
- message generated by the caller.@VisibleForTesting public static HttpChannelEOFException maybeExtractChannelException(String path, String message, Throwable thrown)
NoHttpResponseException
or an OpenSSL channel exception.
This is based on string matching, which is inelegant and brittle.path
- path of the failure.message
- message generated by the caller.thrown
- inner exception.Copyright © 2008–2024 Apache Software Foundation. All rights reserved.