Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Return JsonResult from Exception on Controller
protected override void OnException(ExceptionContext filterContext)
{
filterContext.Result = Json(new { error = filterContext.Exception.ToString()},JsonRequestBehavior.AllowGet());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment