diff --git a/modules/openapi-generator/src/main/resources/typescript/http/http.mustache b/modules/openapi-generator/src/main/resources/typescript/http/http.mustache
index 2f66d4b8996e31f2fcc14c1e6e9fa5c7ec06e209..a74cfdf8a26e5e2e9fcd6e9fcfaecbcff9e1eac4 100644
--- a/modules/openapi-generator/src/main/resources/typescript/http/http.mustache
+++ b/modules/openapi-generator/src/main/resources/typescript/http/http.mustache
@@ -98,7 +98,7 @@ class URLParse {
 {{/platforms}}
 
 export class HttpException extends Error {
-    public constructor(msg: string) {
+    public constructor(msg: string, public code?: number) {
         super(msg);
     }
 }
diff --git a/samples/client/others/typescript/builds/with-unique-items/http/http.ts b/samples/client/others/typescript/builds/with-unique-items/http/http.ts
index f19e206b19ffcc14eb824fc5a372dce19d3d9c06..149b750e3676222e8efbd79c7a3038a0f5ff18eb 100644
--- a/samples/client/others/typescript/builds/with-unique-items/http/http.ts
+++ b/samples/client/others/typescript/builds/with-unique-items/http/http.ts
@@ -27,7 +27,7 @@ export type HttpFile = Blob & { readonly name: string };
 
 
 export class HttpException extends Error {
-    public constructor(msg: string) {
+    public constructor(msg: string, public code?: number) {
         super(msg);
     }
 }
diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts
index f19e206b19ffcc14eb824fc5a372dce19d3d9c06..149b750e3676222e8efbd79c7a3038a0f5ff18eb 100644
--- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts
+++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/http/http.ts
@@ -27,7 +27,7 @@ export type HttpFile = Blob & { readonly name: string };
 
 
 export class HttpException extends Error {
-    public constructor(msg: string) {
+    public constructor(msg: string, public code?: number) {
         super(msg);
     }
 }
diff --git a/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts
index 3b6e1461d924883ca24c3e959295d1f0c6a1a2c7..1efcb0e46b754b55e836340468b6fdd5aed9a104 100644
--- a/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts
+++ b/samples/openapi3/client/petstore/typescript/builds/default/http/http.ts
@@ -35,7 +35,7 @@ export type HttpFile = {
 
 
 export class HttpException extends Error {
-    public constructor(msg: string) {
+    public constructor(msg: string, public code?: number) {
         super(msg);
     }
 }
diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts
index 139149cec973e415bd1f2b959afd407212d854bd..4ae25b503d935a7a199524b627e2d55f91f867ce 100644
--- a/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts
+++ b/samples/openapi3/client/petstore/typescript/builds/deno/http/http.ts
@@ -56,7 +56,7 @@ class URLParse {
 }
 
 export class HttpException extends Error {
-    public constructor(msg: string) {
+    public constructor(msg: string, public code?: number) {
         super(msg);
     }
 }
diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts
index 3b6e1461d924883ca24c3e959295d1f0c6a1a2c7..1efcb0e46b754b55e836340468b6fdd5aed9a104 100644
--- a/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts
+++ b/samples/openapi3/client/petstore/typescript/builds/inversify/http/http.ts
@@ -35,7 +35,7 @@ export type HttpFile = {
 
 
 export class HttpException extends Error {
-    public constructor(msg: string) {
+    public constructor(msg: string, public code?: number) {
         super(msg);
     }
 }
diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts
index 4b9ef54beeb5626ec3a5013ec8d9264cbe5c2245..1a0e8e2bc73e71eeb6a46e6e9cba83feeb9b719d 100644
--- a/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts
+++ b/samples/openapi3/client/petstore/typescript/builds/jquery/http/http.ts
@@ -27,7 +27,7 @@ export type HttpFile = Blob & { readonly name: string };
 
 
 export class HttpException extends Error {
-    public constructor(msg: string) {
+    public constructor(msg: string, public code?: number) {
         super(msg);
     }
 }
diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts
index 3b6e1461d924883ca24c3e959295d1f0c6a1a2c7..1efcb0e46b754b55e836340468b6fdd5aed9a104 100644
--- a/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts
+++ b/samples/openapi3/client/petstore/typescript/builds/object_params/http/http.ts
@@ -35,7 +35,7 @@ export type HttpFile = {
 
 
 export class HttpException extends Error {
-    public constructor(msg: string) {
+    public constructor(msg: string, public code?: number) {
         super(msg);
     }
 }