We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 445ad43 commit 5a43e41Copy full SHA for 5a43e41
firebaseai/src/Internal/HttpHelpers.cs
@@ -106,13 +106,12 @@ internal static async Task ValidateHttpResponse(HttpResponseMessage response)
106
}
107
108
// Construct the exception with as much information as possible.
109
- var ex = new HttpRequestException(
+ throw new HttpRequestException(
110
$"HTTP request failed with status code: {(int)response.StatusCode} ({response.ReasonPhrase}).\n" +
111
- $"Error Content: {errorContent}"
+ $"Error Content: {errorContent}",
112
+ null,
113
+ response.StatusCode
114
);
- ex.Data["StatusCode"] = (int)response.StatusCode;
-
115
- throw ex;
116
117
118
0 commit comments