Skip to content

Commit 8dc8f58

Browse files
committed
improve error messaging when unsupported vendor shape used
1 parent 8fac9c6 commit 8dc8f58

File tree

1 file changed

+6
-6
lines changed
  • tools/code-generation/smithy/codegen/cpp-smoke-tests-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators

1 file changed

+6
-6
lines changed

tools/code-generation/smithy/codegen/cpp-smoke-tests-codegen/src/main/java/com/amazonaws/util/awsclientsmithygenerator/generators/SmokeTestsParser.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -235,16 +235,16 @@ private List<SmokeTestData> parseSmokeTests(
235235
}
236236

237237
//get configuration properties
238-
if(AwsSmokeTestModel.hasAwsVendorParams(testcase))
239-
{
238+
if(AwsSmokeTestModel.hasAwsVendorParams(testcase)) {
240239
ClientConfiguration config = new ClientConfiguration(AwsSmokeTestModel.getAwsVendorParams(testcase).get());
241240
test.setConfig(config);
242-
}
243-
else if (serviceShape.getId().getName().equalsIgnoreCase("s3") &&
244-
AwsSmokeTestModel.hasS3VendorParams(testcase))
245-
{
241+
} else if (serviceShape.getId().getName().equalsIgnoreCase("s3") && AwsSmokeTestModel.hasS3VendorParams(testcase)) {
246242
ClientConfiguration config = new ClientConfiguration(AwsSmokeTestModel.getS3VendorParams(testcase).get());
247243
test.setConfig(config);
244+
} else {
245+
throw testcase.getVendorParamsShape()
246+
.map(shapeId -> new RuntimeException(String.format("Unsupported vendor shape %s, must be aws.test#AwsVendorParams or aws.test#S3VendorParams", shapeId.getName())))
247+
.orElseThrow(() -> new RuntimeException("No Vendor parameter shape found, must be aws.test#AwsVendorParams or aws.test#S3VendorParams"));
248248
}
249249
test.setTestcaseName(testcase.getId());
250250

0 commit comments

Comments
 (0)