asp.net web api2 - How to get original exception message to client from web api -


i have asp.net web api method following one

[httpget]         public ihttpactionresult getalldesignations()         {             try             {                 designationapplicationservice des = new designationapplicationservice();                 list<designation> dslist = des.getalldesignations();                 return ok(dslist);             }             catch (exception ex)             {                  mycustomexception exception = new mycustomexception(ex, "error in loading designations", myenum.exceptiontype.error);                 return internalservererror(exception);             }         }  

i calling api method in c# client application. if exception occurred in api method, have thrown own custom exception. gets "iternal server (500)" error api

is there method original exception in client application?enter code here

you try setting includeerrordetailpolicy configuration 'always'.

see page: http://www.asp.net/web-api/overview/advanced/configuring-aspnet-web-api


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -