diff --git a/packages/mindplot/src/components/LocalStorageManager.js b/packages/mindplot/src/components/LocalStorageManager.js index 9b1f4b59..46dc8211 100644 --- a/packages/mindplot/src/components/LocalStorageManager.js +++ b/packages/mindplot/src/components/LocalStorageManager.js @@ -45,6 +45,9 @@ class LocalStorageManager extends PersistenceManager { success(response) { xml = response; }, + error(xhr, ajaxOptions, thrownError) { + console.error(`Request error => status:${xhr.status} ,thrownError: ${thrownError}`); + }, }); // If I could not load it from a file, hard code one. if (xml == null) { diff --git a/packages/mindplot/src/components/RestPersistenceManager.js b/packages/mindplot/src/components/RestPersistenceManager.js index a912369a..4e743079 100644 --- a/packages/mindplot/src/components/RestPersistenceManager.js +++ b/packages/mindplot/src/components/RestPersistenceManager.js @@ -108,6 +108,9 @@ class RESTPersistenceManager extends PersistenceManager { async: false, method: 'post', headers: { 'Content-Type': 'application/json; charset=utf-8', Accept: 'application/json' }, + error(xhr, ajaxOptions, thrownError) { + console.error(`Request error => status:${xhr.status} ,thrownError: ${thrownError}`); + }, }); } @@ -119,6 +122,9 @@ class RESTPersistenceManager extends PersistenceManager { method: 'put', headers: { 'Content-Type': 'text/plain' }, data: 'false', + error(xhr, ajaxOptions, thrownError) { + console.error(`Request error => status:${xhr.status} ,thrownError: ${thrownError}`); + }, }); } @@ -147,11 +153,14 @@ class RESTPersistenceManager extends PersistenceManager { success(responseText) { xml = responseText; }, + error(xhr, ajaxOptions, thrownError) { + console.error(`Request error => status:${xhr.status} ,thrownError: ${thrownError}`); + }, }); // If I could not load it from a file, hard code one. if (xml == null) { - throw new Error('Map could not be loaded'); + throw new Error(`Map with id ${mapId} could not be loaded`); } return xml;