MVC App, client makes request to server, error happens, want to send the msg back to the client. Tried HttpStatusCodeResult but just returns a 404 with no message, I need the details of the error sent back to the client.
public ActionResult GetPLUAndDeptInfo(string authCode)
{
try
{
//code everything works fine
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
return new HttpStatusCodeResult(404, "Error in cloud - GetPLUInfo" + ex.Message);
}
}
ModelState
. - If OP wants to show a warning instead of an error, there is nothing to switch on. Any thoughts? – Ajar