From 982e6f4bad8a3f7dba0dae5ccc7594e54089d610 Mon Sep 17 00:00:00 2001 From: Rico Suter Date: Tue, 22 Aug 2017 19:12:42 +0200 Subject: [PATCH] SwaggerException extends Error (TS), #771 --- src/NSwag.CodeGeneration.TypeScript/Templates/FileTemplate.cs | 2 +- src/NSwag.CodeGeneration.TypeScript/Templates/FileTemplate.tt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NSwag.CodeGeneration.TypeScript/Templates/FileTemplate.cs b/src/NSwag.CodeGeneration.TypeScript/Templates/FileTemplate.cs index 097582c93a..277b6c887a 100644 --- a/src/NSwag.CodeGeneration.TypeScript/Templates/FileTemplate.cs +++ b/src/NSwag.CodeGeneration.TypeScript/Templates/FileTemplate.cs @@ -283,7 +283,7 @@ public virtual string TransformText() #line default #line hidden - this.Write(@"export class SwaggerException { + this.Write(@"export class SwaggerException extends Error { message: string; status: number; response: string; diff --git a/src/NSwag.CodeGeneration.TypeScript/Templates/FileTemplate.tt b/src/NSwag.CodeGeneration.TypeScript/Templates/FileTemplate.tt index 34a8f4f64b..244add54e4 100644 --- a/src/NSwag.CodeGeneration.TypeScript/Templates/FileTemplate.tt +++ b/src/NSwag.CodeGeneration.TypeScript/Templates/FileTemplate.tt @@ -80,7 +80,7 @@ export interface FileResponse { <#}#> <#if(Model.RequiresSwaggerExceptionClass){#> -export class SwaggerException { +export class SwaggerException extends Error { message: string; status: number; response: string;