From 7db903e7c8c70f8a99da85d3a67173384c16c871 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 4 Aug 2018 15:11:15 +0200 Subject: [PATCH 1/2] Log 'xhr' variable in console when an unexpected error occur --- src/js/yunohost/helpers.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/yunohost/helpers.js b/src/js/yunohost/helpers.js index d057de21..d5871d74 100644 --- a/src/js/yunohost/helpers.js +++ b/src/js/yunohost/helpers.js @@ -137,6 +137,7 @@ // Return HTTP error code at least else { var errorMessage = xhr.status+' '+xhr.statusText; + console.log(xhr); c.flash('fail', y18n.t('error_server_unexpected', [errorMessage])); } From e113c56cae95951681094bae5ca79c3823711293 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 4 Aug 2018 15:15:32 +0200 Subject: [PATCH 2/2] (Put the log after the flash in case the console.log fails for some reason) --- src/js/yunohost/helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/yunohost/helpers.js b/src/js/yunohost/helpers.js index d5871d74..2d6bf859 100644 --- a/src/js/yunohost/helpers.js +++ b/src/js/yunohost/helpers.js @@ -137,8 +137,8 @@ // Return HTTP error code at least else { var errorMessage = xhr.status+' '+xhr.statusText; - console.log(xhr); c.flash('fail', y18n.t('error_server_unexpected', [errorMessage])); + console.log(xhr); } // Remove loader if any