|
18 | 18 | import java.util.Collection;
|
19 | 19 | import java.util.HashSet;
|
20 | 20 | import java.util.Set;
|
| 21 | +import software.amazon.smithy.codegen.core.CodegenException; |
21 | 22 | import software.amazon.smithy.codegen.core.SymbolProvider;
|
22 | 23 | import software.amazon.smithy.model.Model;
|
23 | 24 | import software.amazon.smithy.model.shapes.CollectionShape;
|
@@ -94,9 +95,14 @@ void writeCollectionFilterSensitiveLog(TypeScriptWriter writer, MemberShape coll
|
94 | 95 | }
|
95 | 96 | );
|
96 | 97 | } else {
|
97 |
| - // This path will never reach because of recursive isIterationRequired. |
98 |
| - // Adding it to not break the code, if it does reach in future. |
99 |
| - writer.write("item => item"); |
| 98 | + // This path should not reach because of recursive isIterationRequired. |
| 99 | + throw new CodegenException(String.format( |
| 100 | + "CollectionFilterSensitiveLog attempted for %s while it was not required", |
| 101 | + memberShape.getType() |
| 102 | + )); |
| 103 | + // For quick-fix in case of high severity issue: |
| 104 | + // comment out the exception above and uncomment the line below. |
| 105 | + // writer.write("item => item"); |
100 | 106 | }
|
101 | 107 | }
|
102 | 108 |
|
@@ -129,9 +135,14 @@ void writeMapFilterSensitiveLog(TypeScriptWriter writer, MemberShape mapMember)
|
129 | 135 | }
|
130 | 136 | );
|
131 | 137 | } else {
|
132 |
| - // This path will never reach because of recursive isIterationRequired. |
133 |
| - // Adding it to not break the code, if it does reach in future. |
134 |
| - writer.write("[key]: value,"); |
| 138 | + // This path should not reach because of recursive isIterationRequired. |
| 139 | + throw new CodegenException(String.format( |
| 140 | + "MapFilterSensitiveLog attempted for %s while it was not required", |
| 141 | + memberShape.getType() |
| 142 | + )); |
| 143 | + // For quick-fix in case of high severity issue: |
| 144 | + // comment out the exception above and uncomment the line below. |
| 145 | + // writer.write("[key]: value,"); |
135 | 146 | }
|
136 | 147 | }
|
137 | 148 | );
|
|
0 commit comments