Skip to content

Commit 7e4e4aa

Browse files
committed
Removing numattempts larger than 0 valiadations
1 parent ad088c0 commit 7e4e4aa

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

core/aws-core/src/main/java/software/amazon/awssdk/awscore/exception/AwsServiceException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public String getMessage() {
7474
joiner.add(serviceDiagnostics());
7575
}
7676

77-
if (numAttempts() != null && numAttempts() > 0) {
77+
if (numAttempts() != null) {
7878
SdkDiagnostics diagnostics = SdkDiagnostics.builder().numAttempts(numAttempts()).build();
7979
joiner.add(diagnostics.toString());
8080
}

core/aws-core/src/test/java/software/amazon/awssdk/awscore/exception/AwsServiceExceptionTest.java

+3
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ private static Stream<Arguments> exceptionMessageTestCases() {
113113
Arguments.of(
114114
3,
115115
"errorMessage (Service: serviceName, Status Code: 500, Request ID: requestId) (SDK Attempt Count: 3)"),
116+
Arguments.of(
117+
0,
118+
"errorMessage (Service: serviceName, Status Code: 500, Request ID: requestId) (SDK Attempt Count: 0)"),
116119
Arguments.of(
117120
null,
118121
"errorMessage (Service: serviceName, Status Code: 500, Request ID: requestId)")

core/sdk-core/src/main/java/software/amazon/awssdk/core/exception/SdkClientException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static SdkClientException create(String message, Throwable cause) {
5050
@Override
5151
public String getMessage() {
5252
String message = rawMessage();
53-
if (numAttempts() != null && numAttempts() > 0) {
53+
if (numAttempts() != null) {
5454
SdkDiagnostics sdkDiagnostics = SdkDiagnostics.builder().numAttempts(numAttempts()).build();
5555
message = message + " " + sdkDiagnostics;
5656
}

core/sdk-core/src/main/java/software/amazon/awssdk/core/exception/SdkDiagnostics.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static Builder builder() {
3535
@Override
3636
public String toString() {
3737
StringJoiner details = new StringJoiner(", ", "(", ")");
38-
if (numAttempts != null && numAttempts > 0) {
38+
if (numAttempts != null) {
3939
details.add("SDK Attempt Count: " + numAttempts);
4040
return details.toString();
4141
}

0 commit comments

Comments
 (0)