I have an ASP.NET MVC application, where I call method by AJAX:
$.ajax({
dataType: 'json',
url: "/Admin/AllowVideoUpload",
type: "POST",
data: { val: val },
error: function () {
alert('Error');
}
});
if success - nothing happens on client side, if error - get 'Error' message. But error can be by different reasons - problem inside "AllowVideoUpload" method or user lost his credentials (AdminController has attribute 'Authorize(Roles = "Admin")'). I want to differ these 2 types of error. How to do it?