Skip to content

Commit 0d32b4a

Browse files
authored
fix: Add details to error message (#459)
Add more details to the error message in #458. This adds workaround suggestions and more details.
1 parent 99cce95 commit 0d32b4a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main/java/software/amazon/encryption/s3/internal/ConvertSDKRequests.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,16 @@ public static CreateMultipartUploadRequest convert(PutObjectRequest request) {
121121
default:
122122
// Rather than silently dropping the value,
123123
// we loudly signal that we don't know how to handle this field.
124-
throw new IllegalArgumentException("Unknown PutObjectRequest field " + f.locationName() + ".");
124+
throw new IllegalArgumentException(
125+
f.locationName() + " is an unknown field. " +
126+
"The S3 Encryption Client does not recognize this option and cannot set it on the CreateMultipartUploadRequest." +
127+
"This may be a new S3 feature." +
128+
"Please report this to the Amazon S3 Encryption Client for Java: " +
129+
"https://github.com/aws/amazon-s3-encryption-client-java/issues." +
130+
"To work around this issue you can disable multi part upload," +
131+
"use the Async client, or not set this value on PutObject." +
132+
"You may be able to update this value after the PutObject request completes."
133+
);
125134
}
126135
}
127136
});

0 commit comments

Comments
 (0)