resq/public/assets/js/common.js
2018-02-17 13:02:29 +08:00

22 lines
No EOL
493 B
JavaScript

$(function() {
$(document).ajaxError(function(event, response, ajaxSettings, thrownError) {
if (response.statusText === "abort") {
// we do not catch aborted calls
return;
}
switch (response.status) {
case 422:
// we leave 422 handling to individual calls
break;
case 500:
default:
swal({
title: 'Whoops!',
text: 'We encountered a problem. Please contact technical support.',
type: 'error'
});
break;
}
});
});