Skip to content

Commit 73e0071

Browse files
committed
change Promise<unknown> to Promise<never>
1 parent ef1e3b7 commit 73e0071

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpBindingProtocolGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,7 @@ private void generateOperationResponseDeserializer(
21212121
// status code that's not the modeled code (300 or higher). This allows for
21222122
// returning other 2XX codes that don't match the defined value.
21232123
writer.openBlock("if (output.statusCode !== $L && output.statusCode >= 300) {", "}", trait.getCode(),
2124-
() -> writer.write("return $L(output, context) as any;", errorMethodName));
2124+
() -> writer.write("return $L(output, context);", errorMethodName));
21252125

21262126
// Start deserializing the response.
21272127
writer.openBlock("const contents: any = map({", "});", () -> {

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpProtocolGeneratorUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ static Set<StructureShape> generateUnifiedErrorDispatcher(
332332
writer.openBlock("const $L = async(\n"
333333
+ " output: $T,\n"
334334
+ " context: __SerdeContext,\n"
335-
+ "): Promise<unknown> => {", "}", errorMethodName, responseType, () -> {
335+
+ "): Promise<never> => {", "}", errorMethodName, responseType, () -> {
336336
// Prepare error response for parsing error code. If error code needs to be parsed from response body
337337
// then we collect body and parse it to JS object, otherwise leave the response body as is.
338338
if (shouldParseErrorBody) {

smithy-typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/integration/HttpRpcProtocolGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ private void generateOperationDeserializer(GenerationContext context, OperationS
461461
+ "): Promise<$T> => {", "}", methodName, responseType, serdeContextType, outputType, () -> {
462462
// Redirect error deserialization to the dispatcher
463463
writer.openBlock("if (output.statusCode >= 300) {", "}", () -> {
464-
writer.write("return $L(output, context) as any;", errorMethodName);
464+
writer.write("return $L(output, context);", errorMethodName);
465465
});
466466

467467
// Start deserializing the response.

0 commit comments

Comments
 (0)