I have a request in Ajax that asks for payments on a third-party server, I would like to know how I can handle HTTP errors. Example: 'server responded with a status of 404 (Not Found)' This error can happen for several reasons, but it only appears in the log, I would like to treat it and it shows in an elegant way for the user.
$.ajax(settings).done(function (response) {
console.log(response);
_RecurrentPaymentId = response.Payment.RecurrentPayment.RecurrentPaymentId;
_NextRecurrency = response.Payment.RecurrentPayment.NextRecurrency;
_Status = response.Payment.Status;
});