mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-28 23:52:36 +01:00
Throw UnrecognizedResponseExceptions from ApiClient
This commit is contained in:
@@ -164,7 +164,14 @@ namespace Tgstation.Server.Client
|
||||
if (String.IsNullOrWhiteSpace(json))
|
||||
json = JsonConvert.SerializeObject(new object());
|
||||
|
||||
return JsonConvert.DeserializeObject<TResult>(json, serializerSettings);
|
||||
try
|
||||
{
|
||||
return JsonConvert.DeserializeObject<TResult>(json, serializerSettings);
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
throw new UnrecognizedResponseException(json, response.StatusCode);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user