diff --git a/public/js/vroom.js b/public/js/vroom.js index def9df3..5326a34 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -1487,18 +1487,19 @@ function initVroom(room) { }) }, error: function(data) { - $.notify(locale.ERROR_OCCURRED, 'error'); + data = data.responseJSON; + if (data.msg){ + $.notify(data.msg, 'error'); + } + else{ + $.notify(locale.ERROR_OCCURRED, 'error'); + } }, success: function(data) { - if (data.status == 'success'){ - if (data.msg){ - $.notify(data.msg, 'success'); - } - loadEtherpadIframe(); - } - else if (data.msg){ - $.notify(data.msg, 'error'); + if (data.msg){ + $.notify(data.msg, 'success'); } + loadEtherpadIframe(); } }); } diff --git a/vroom.pl b/vroom.pl index a513ea2..91187b1 100755 --- a/vroom.pl +++ b/vroom.pl @@ -1803,8 +1803,10 @@ any '/api' => sub { return $self->render( json => { msg => $self->l('ERROR_OCCURRED'), + err => 'ERROR_OCCURRED', status => 'error' - } + }, + styaus => 503 ); } # Delete a room