zijianhuang / webapiclientgen

Strongly Typed Client API Generators generate strongly typed client APIs in C# .NET and in TypeScript for jQuery and Angular 2+ from ASP.NET Web API and .NET Core Web API
MIT License
167 stars 38 forks source link

not graceful enough to deal with InvalidOperationException when the api definition has something wrong #17

Closed zijianhuang closed 7 years ago

zijianhuang commented 7 years ago

System.InvalidOperationException occurred HResult=0x80131509 Message=This API function XXX has more than 1 FromBody bindings in parameters Source=Fonlow.WebApiClientGen

` try { CodeGen.GenerateClientAPIs(webRootPath, settings, apiDescriptions); } catch (Fonlow.Web.Meta.CodeGenException e) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.BadRequest) { ReasonPhrase = e.Message }); }

`

zijianhuang commented 7 years ago
  1. more details in the response text
  2. write details to Trace.Error