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.
|
static software.amazon.awssdk.core.exception.SdkException |
maybeProcessEncryptionClientException(software.amazon.awssdk.core.exception.SdkException exception)
Attempts to extract the underlying SdkException from an S3 encryption client exception.
|
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 software.amazon.awssdk.core.exception.SdkException maybeProcessEncryptionClientException(software.amazon.awssdk.core.exception.SdkException exception)
This method is designed to handle exceptions that may be wrapped within S3EncryptionClientExceptions. It performs the following steps:
The method aims to unwrap nested exceptions to provide more meaningful error information, particularly in the context of S3 encryption operations.
exception - The SdkException to analyze. This may be a wrapper exception
containing a more specific underlying cause.SdkException,
AwsServiceExceptionpublic 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–2025 Apache Software Foundation. All rights reserved.