From 1a6722f7b8c8dd745eace6a41b9bbcbfe22175dd Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 5 Feb 2015 18:54:54 +0100 Subject: [PATCH] HTTP codes in get_pad_session API call --- public/js/vroom.js | 19 ++++++++++--------- vroom.pl | 4 +++- 2 files changed, 13 insertions(+), 10 deletions(-) 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