File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
modules/swagger-codegen/src/main/resources/csharp Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ namespace {{package}} {
83
83
// make the HTTP request
84
84
IRestResponse response = restClient.Execute(_request);
85
85
if (((int)response.StatusCode) >= 400) {
86
- throw new ApiException ((int)response.StatusCode, " Error calling {{nickname}}: " + response.Content);
86
+ throw new ApiException ((int)response.StatusCode, " Error calling {{nickname}}: " + response.Content, response.Content );
87
87
}
88
88
{ {#returnType} }return ({ {{returnType} }}) ApiInvoker.Deserialize(response.Content, typeof({ {{returnType} }}));{ {/returnType} }{ {^returnType} }
89
89
return;{ {/returnType} }
@@ -125,7 +125,7 @@ namespace {{package}} {
125
125
// make the HTTP request
126
126
IRestResponse response = await restClient.ExecuteTaskAsync(_request);
127
127
if (((int)response.StatusCode) >= 400) {
128
- throw new ApiException ((int)response.StatusCode, " Error calling {{nickname}}: " + response.Content);
128
+ throw new ApiException ((int)response.StatusCode, " Error calling {{nickname}}: " + response.Content, response.Content );
129
129
}
130
130
{ {#returnType} }return ({ {{returnType} }}) ApiInvoker.Deserialize(response.Content, typeof({ {{returnType} }}));{ {/returnType} }{ {^returnType} }
131
131
return;{ {/returnType} }
Original file line number Diff line number Diff line change @@ -6,12 +6,19 @@ namespace {{invokerPackage}} {
6
6
7
7
public int ErrorCode { get; set; }
8
8
9
+ public dynamic ErrorContent { get; private set; }
10
+
9
11
public ApiException() { }
10
12
11
13
public ApiException(int errorCode, string message) : base(message) {
12
14
this.ErrorCode = errorCode;
13
15
}
14
16
17
+ public ApiException(int errorCode, string message, dynamic errorContent = null) : base(message) {
18
+ this.errorCode = errorCode;
19
+ this.errorContent = errorContent;
20
+ }
21
+
15
22
}
16
23
17
24
}
You can’t perform that action at this time.
0 commit comments