Fix: drop __ERROR__
This commit is contained in:
parent
838c21e3b3
commit
90aadfd728
|
@ -203,24 +203,18 @@
|
|||
|
||||
|
||||
function getResource(url, options) {
|
||||
return new Promise(resolve => {
|
||||
if (url.startsWith('#')) {
|
||||
resolve(document.getElementById(url.slice(1)).textContent);
|
||||
} else {
|
||||
API.download(Object.assign({
|
||||
return Promise.resolve(document.getElementById(url.slice(1)).textContent);
|
||||
}
|
||||
return API.download(Object.assign({
|
||||
url,
|
||||
timeout: 60e3,
|
||||
// USO can't handle POST requests for style json
|
||||
body: null,
|
||||
}, options)).then(result => {
|
||||
const error = result && result.__ERROR__;
|
||||
if (error) {
|
||||
}, options))
|
||||
.catch(error => {
|
||||
alert('Error' + (error ? '\n' + error : ''));
|
||||
} else {
|
||||
resolve(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user