better config error handling

This commit is contained in:
antelle 2017-05-01 21:19:43 +02:00
parent 1195408b1d
commit 5f2eea2c29
1 changed files with 2 additions and 1 deletions

View File

@ -59,7 +59,8 @@ const AppModel = Backbone.Model.extend({
xhr.addEventListener('load', () => {
let response = xhr.response;
if (!response) {
this.appLogger.error('Error loading app config', xhr.statusText);
const errorDesc = xhr.statusText === 'OK' ? 'Malformed JSON' : xhr.statusText;
this.appLogger.error('Error loading app config', errorDesc);
return callback(true);
}
if (typeof response === 'string') {