I'm performing some ajax requests in a js.
Everything is working perfectly ... however, when a code 500 is returned by the server, the application does not continue its flow.
how is it possible to make so that even when an exception 500 is returned the code continues?
async function isValid(data) {
let result = true;
await $.ajax({
url: '@Url.Action("GetValid", "User")',
cache: false,
data: data,
success: function (data) {
result = data;
},
error: function (data) {
result = false;
// break code ... returned code 500
}
});
return result;
}
Result in Console
Failed to load resource: the server responded with a status of 500 ()
index.html:45 Uncaught (in promise) Object