mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 14:47:56 +01:00
Improve error message on load error
This commit is contained in:
parent
e0c18b9439
commit
a3126f8532
@ -45,6 +45,9 @@ class LocalStorageManager extends PersistenceManager {
|
|||||||
success(response) {
|
success(response) {
|
||||||
xml = 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 I could not load it from a file, hard code one.
|
||||||
if (xml == null) {
|
if (xml == null) {
|
||||||
|
@ -108,6 +108,9 @@ class RESTPersistenceManager extends PersistenceManager {
|
|||||||
async: false,
|
async: false,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
headers: { 'Content-Type': 'application/json; charset=utf-8', Accept: 'application/json' },
|
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',
|
method: 'put',
|
||||||
headers: { 'Content-Type': 'text/plain' },
|
headers: { 'Content-Type': 'text/plain' },
|
||||||
data: 'false',
|
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) {
|
success(responseText) {
|
||||||
xml = 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 I could not load it from a file, hard code one.
|
||||||
if (xml == null) {
|
if (xml == null) {
|
||||||
throw new Error('Map could not be loaded');
|
throw new Error(`Map with id ${mapId} could not be loaded`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return xml;
|
return xml;
|
||||||
|
Loading…
Reference in New Issue
Block a user