Skip to content

Commit dbb0e6a

Browse files
committed
Update exception type
1 parent 21ff181 commit dbb0e6a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/crt/internal/signer/AwsChunkedV4aPayloadSigner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public CompletableFuture<Pair<SdkHttpRequest.Builder, Optional<Publisher<ByteBuf
186186
.map(Long::parseLong)
187187
// should not happen, this header is added by
188188
// moveContentLength
189-
.orElseThrow(() -> new RuntimeException(
189+
.orElseThrow(() -> new IllegalArgumentException(
190190
X_AMZ_DECODED_CONTENT_LENGTH + " header not present"));
191191

192192
long encodedContentLength = calculateEncodedContentLength(decodedContentLength, checksum);

core/http-auth-aws/src/main/java/software/amazon/awssdk/http/auth/aws/internal/signer/AwsChunkedV4PayloadSigner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private void signCommon(ChunkedEncodedPayload payload, V4RequestSigningResult re
121121
.orElseThrow(() -> {
122122
String msg = String.format("Expected header '%s' to be present",
123123
X_AMZ_DECODED_CONTENT_LENGTH);
124-
return new RuntimeException(msg);
124+
return new IllegalArgumentException(msg);
125125
}));
126126

127127
String checksum = request.firstMatchingHeader(X_AMZ_CONTENT_SHA256).orElseThrow(

0 commit comments

Comments
 (0)