forked from loafle/openapi-generator-original
Catch all exceptions on Deserialize
If you look at the source of NewtonSoft.Json, you'll see that DeserializeObject never throws an IOException. All exceptions should be caught in this method, just like Serialize.
This commit is contained in:
parent
52971e6aa9
commit
a81e5096f5
@ -235,7 +235,7 @@ namespace {{packageName}}.Client
|
|||||||
{
|
{
|
||||||
return JsonConvert.DeserializeObject(content, type);
|
return JsonConvert.DeserializeObject(content, type);
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
throw new ApiException(500, e.Message);
|
throw new ApiException(500, e.Message);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user