From a81e5096f5f97f61c7b71d174583939eb45c3fed Mon Sep 17 00:00:00 2001 From: adamholdenyall Date: Tue, 28 Jul 2015 09:53:10 -0500 Subject: [PATCH] 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. --- .../src/main/resources/csharp/ApiClient.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache index 50ac120c4ea..c93537a740d 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/ApiClient.mustache @@ -235,7 +235,7 @@ namespace {{packageName}}.Client { return JsonConvert.DeserializeObject(content, type); } - catch (IOException e) + catch (Exception e) { throw new ApiException(500, e.Message); }