Skip to content

Commit ee71f8f

Browse files
JordonPhillipsadamthom-amzn
authored andcommitted
chore: serialize rest json error code header (aws#2166)
1 parent 5d9bc5f commit ee71f8f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/RestJsonProtocolGenerator.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ protected void writeDefaultHeaders(GenerationContext context, OperationShape ope
9090
AwsProtocolUtils.generateUnsignedPayloadSigV4Header(context, operation);
9191
}
9292

93+
@Override
94+
protected void writeDefaultErrorHeaders(GenerationContext context, StructureShape error) {
95+
super.writeDefaultErrorHeaders(context, error);
96+
context.getWriter().write("'x-amzn-errortype': $S,", error.getId().getName());
97+
}
98+
9399
@Override
94100
public void serializeInputDocument(
95101
GenerationContext context,

0 commit comments

Comments
 (0)