none
WebAPI : Returning HttpResponseException

    Question

  • What is the proper way to return HttpResponseException?

    catch (Exception ex)
    {
    throw new HttpResponseException(new System.Net.Http.HttpResponseMessage()
    {
    Content = new System.Net.Http.StringContent(ex.Source),
    ReasonPhrase = ex.Message
    });
    }

    Getting this error message:

    Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details.

    Friday, August 19, 2016 9:50 PM

Answers

  • I'd try them here in microsoft official IIS / ASP.Net forums

    http://forums.asp.net/

    http://forums.iis.net/

     

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Saturday, August 20, 2016 5:45 AM
    Moderator