i am learning web api in c#. i want to know how to catch exception message from the response object send from the server side.
suppose this is the response exception message being thrown by the server side. so how do i catch it on the client side. by using normal try catch its not showing the message.
try
{
}
catch{Exception exception)
{
var errorMessage = new HttpResponseMessage(HttpStatusCode.BadRequest) { Content = new StringContent(exception.Message) };
throw new HttpResponseException(errorMessage);
}