Skip to content

Commit 475fa44

Browse files
committed
feat: ApiExceptions now will show json instead ReasonPhrase for all possible cases.
1 parent e6ea939 commit 475fa44

File tree

3,225 files changed

+7701
-7701
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,225 files changed

+7701
-7701
lines changed

src/libs/AutoSDK/Sources/Sources.Methods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ public static string GenerateResponse(
420420
{(!string.IsNullOrWhiteSpace(x.Type.CSharpTypeWithoutNullability) ? $@"
421421
throw new global::{endPoint.Settings.Namespace}.ApiException<{x.Type.CSharpTypeWithNullabilityForValueTypes}>(" : $@"
422422
throw new global::{endPoint.Settings.Namespace}.ApiException(")}
423-
message: __response.ReasonPhrase ?? string.Empty,
423+
message: __content_{x.StatusCode} ?? __response.ReasonPhrase ?? string.Empty,
424424
statusCode: __response.StatusCode)
425425
{{
426426
ResponseBody = __content_{x.StatusCode},

src/tests/AutoSDK.SnapshotTests/Snapshots/ai21/NewtonsoftJson/_#G.Api.ConvertDocumentFileStudioV1ChatFilesConvertPost.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ partial void ProcessConvertDocumentFileStudioV1ChatFilesConvertPostResponseConte
110110
}
111111

112112
throw new global::G.ApiException<global::G.HTTPValidationError>(
113-
message: __response.ReasonPhrase ?? string.Empty,
113+
message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
114114
statusCode: __response.StatusCode)
115115
{
116116
ResponseBody = __content_422,

src/tests/AutoSDK.SnapshotTests/Snapshots/ai21/NewtonsoftJson/_#G.Api.GenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganizationIdTokensPost.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ partial void ProcessGenerateOrgTokenStudioV1ConnectorsConnectedUsersOrganization
9797
}
9898

9999
throw new global::G.ApiException<global::G.HTTPValidationError>(
100-
message: __response.ReasonPhrase ?? string.Empty,
100+
message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
101101
statusCode: __response.StatusCode)
102102
{
103103
ResponseBody = __content_422,

src/tests/AutoSDK.SnapshotTests/Snapshots/ai21/NewtonsoftJson/_#G.Api.GetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesDataSourceStatusGet.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ partial void ProcessGetDataSourceStatusStudioV1ConnectorsConnectedUsersOrganizat
103103
}
104104

105105
throw new global::G.ApiException<global::G.HTTPValidationError>(
106-
message: __response.ReasonPhrase ?? string.Empty,
106+
message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
107107
statusCode: __response.StatusCode)
108108
{
109109
ResponseBody = __content_422,

src/tests/AutoSDK.SnapshotTests/Snapshots/ai21/NewtonsoftJson/_#G.Api.GetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganizationIdDataSourcesGet.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ partial void ProcessGetOrgDataSourcesInfoStudioV1ConnectorsConnectedUsersOrganiz
9797
}
9898

9999
throw new global::G.ApiException<global::G.HTTPValidationError>(
100-
message: __response.ReasonPhrase ?? string.Empty,
100+
message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
101101
statusCode: __response.StatusCode)
102102
{
103103
ResponseBody = __content_422,

src/tests/AutoSDK.SnapshotTests/Snapshots/ai21/NewtonsoftJson/_#G.Api.V1ConversationalRag.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ partial void ProcessV1ConversationalRagResponseContent(
105105
}
106106

107107
throw new global::G.ApiException<global::G.HTTPValidationError>(
108-
message: __response.ReasonPhrase ?? string.Empty,
108+
message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
109109
statusCode: __response.StatusCode)
110110
{
111111
ResponseBody = __content_422,

src/tests/AutoSDK.SnapshotTests/Snapshots/ai21/NewtonsoftJson/_#G.ChatClient.V1J2UltraChat.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ partial void ProcessV1J2UltraChatResponseContent(
114114
}
115115

116116
throw new global::G.ApiException<global::G.HTTPValidationError>(
117-
message: __response.ReasonPhrase ?? string.Empty,
117+
message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
118118
statusCode: __response.StatusCode)
119119
{
120120
ResponseBody = __content_422,

src/tests/AutoSDK.SnapshotTests/Snapshots/ai21/NewtonsoftJson/_#G.CompletionClient.V1J2GrandeComplete.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ partial void ProcessV1J2GrandeCompleteResponseContent(
114114
}
115115

116116
throw new global::G.ApiException<global::G.HTTPValidationError>(
117-
message: __response.ReasonPhrase ?? string.Empty,
117+
message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
118118
statusCode: __response.StatusCode)
119119
{
120120
ResponseBody = __content_422,

src/tests/AutoSDK.SnapshotTests/Snapshots/ai21/NewtonsoftJson/_#G.CompletionClient.V1J2GrandeCustomModelComplete.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ partial void ProcessV1J2GrandeCustomModelCompleteResponseContent(
120120
}
121121

122122
throw new global::G.ApiException<global::G.HTTPValidationError>(
123-
message: __response.ReasonPhrase ?? string.Empty,
123+
message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
124124
statusCode: __response.StatusCode)
125125
{
126126
ResponseBody = __content_422,

src/tests/AutoSDK.SnapshotTests/Snapshots/ai21/NewtonsoftJson/_#G.CompletionClient.V1J2GrandeInstructComplete.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ partial void ProcessV1J2GrandeInstructCompleteResponseContent(
114114
}
115115

116116
throw new global::G.ApiException<global::G.HTTPValidationError>(
117-
message: __response.ReasonPhrase ?? string.Empty,
117+
message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
118118
statusCode: __response.StatusCode)
119119
{
120120
ResponseBody = __content_422,

0 commit comments

Comments
 (0)