Skip to content

Commit c382160

Browse files
committed
handle conflicting synthetic base exception name
1 parent 530227c commit c382160

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/PackageApiValidationGenerator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ public void writeTypeIndexTest() {
9292
}
9393

9494
// synthetic base exception
95-
writer.write("$L,", aggregateClientName + "ServiceException");
95+
String baseExceptionName = CodegenUtils.getSyntheticBaseExceptionName(aggregateClientName, model);
96+
writer.write("$L,", baseExceptionName);
9697

9798
// waiters
9899
closure.getWaiterNames().forEach(waiter -> {
@@ -169,7 +170,7 @@ public void writeRuntimeIndexTest() {
169170
);
170171
}
171172

172-
String baseExceptionName = aggregateClientName + "ServiceException";
173+
String baseExceptionName = CodegenUtils.getSyntheticBaseExceptionName(aggregateClientName, model);
173174

174175
// modeled errors and synthetic base error
175176
writer.write("// errors");

0 commit comments

Comments
 (0)