diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsEc2.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsEc2.java index 2dea7b7f1d35..f421e9f5305d 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsEc2.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsEc2.java @@ -95,8 +95,8 @@ public void generateSharedComponents(GenerationContext context) { // Default a 404 status code to the NotFound code. writer.openBlock("if (output.statusCode == 404) {", "}", () -> writer.write("return 'NotFound';")); - // Default to an UnknownError code. - writer.write("return 'UnknownError';"); + // Default to an empty error code so an unmodeled exception is built. + writer.write("return '';"); }); writer.write(""); } diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsQuery.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsQuery.java index 99872f27e666..6e11f7f804bb 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsQuery.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsQuery.java @@ -95,8 +95,8 @@ public void generateSharedComponents(GenerationContext context) { // Default a 404 status code to the NotFound code. writer.openBlock("if (output.statusCode == 404) {", "}", () -> writer.write("return 'NotFound';")); - // Default to an UnknownError code. - writer.write("return 'UnknownError';"); + // Default to an empty error code so an unmodeled exception is built. + writer.write("return '';"); }); writer.write(""); } diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsRestXml.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsRestXml.java index 4fe4db74f8ce..e5f2f2e59676 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsRestXml.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsRestXml.java @@ -116,8 +116,8 @@ public void generateSharedComponents(GenerationContext context) { // Default a 404 status code to the NotFound code. writer.openBlock("if (output.statusCode == 404) {", "}", () -> writer.write("return 'NotFound';")); - // Default to an UnknownError code. - writer.write("return 'UnknownError';"); + // Default to an empty error code so an unmodeled exception is built. + writer.write("return '';"); }); writer.write(""); }