diff --git a/modules/openapi-generator/src/main/resources/typescript/api/api.mustache b/modules/openapi-generator/src/main/resources/typescript/api/api.mustache index 8b1adeb7155..a99424df3e0 100644 --- a/modules/openapi-generator/src/main/resources/typescript/api/api.mustache +++ b/modules/openapi-generator/src/main/resources/typescript/api/api.mustache @@ -208,7 +208,7 @@ export class {{classname}}ResponseProcessor { return body; {{/is2xx}} {{^is2xx}} - throw new ApiException<{{{dataType}}}>({{code}}, "{{message}}", body, response.headers); + throw new ApiException<{{{dataType}}}>(response.httpStatusCode, "{{message}}", body, response.headers); {{/is2xx}} {{/dataType}} {{^dataType}}