Skip to content

Commit

Permalink
handle error 500 in ajax request
Browse files Browse the repository at this point in the history
  • Loading branch information
amtuannguyen committed Nov 20, 2024
1 parent c53e46e commit d4d9aec
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/javascript/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ $(document).ready(function () {
$('.datepicker').datepicker();

if ($('#overview_fees_container').length > 0) {
$.getScript('/alma/reload_fees.js');
$.getScript('/alma/reload_fees.js').fail(function( jqxhr, settings, exception ) {
var error = '<h2 class="text-muted">' + exception + '</h2>';
var reload = '<p class="text-muted"><a href="#" onclick="window.location.reload(); return false;">Reload</a></p>';
var html = error + reload;
$('#overview_fees_container').empty().append(html);
});
}
});

0 comments on commit d4d9aec

Please sign in to comment.