File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -193,11 +193,17 @@ module Http =
193
193
194
194
let body = response.Content.ReadAsStreamAsync() .Result
195
195
let jsonOptions = clientArgs.JsonSerializerOptions |> Option.defaultValue GlobalJsonSerializerOptions
196
- let value = JsonSerializer.Deserialize< 'T>( body, jsonOptions)
196
+
197
+ let value =
198
+ try
199
+ JsonSerializer.Deserialize< 'T>( body, jsonOptions)
200
+ with
201
+ _ -> Unchecked.defaultof<_>
202
+
197
203
let httpRes = { Data = value; Response = response }
198
204
199
205
return
200
- if response.IsSuccessStatusCode then
206
+ if response.IsSuccessStatusCode then
201
207
Response.ok( statusCode = response.StatusCode.ToString(), sizeBytes = dataSize, payload = httpRes)
202
208
else
203
209
Response.fail( statusCode = response.StatusCode.ToString(), sizeBytes = dataSize, payload = httpRes)
You can’t perform that action at this time.
0 commit comments