diff --git a/public/js/vroom.js b/public/js/vroom.js index b4e115e..1236ed8 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -640,7 +640,13 @@ function initVroom(room) { }, async: false, 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){ // Notify others if our role changed diff --git a/vroom.pl b/vroom.pl index 320479a..e6a43af 100755 --- a/vroom.pl +++ b/vroom.pl @@ -1668,8 +1668,10 @@ any '/api' => sub { return $self->render( json => { status => 'error', - msg => $self->l('ERROR_OCCURRED') - } + msg => $self->l('ERROR_OCCURRED'), + err => 'ERROR_OCCURRED' + }, + status => 503 ); } }