Fix: Der pure Aufruf darf nicht durch einen *Catch*-Verarbeitung abgebrochen werden

This commit is contained in:
2022-02-24 16:23:49 +01:00
parent 094b50d33d
commit 0813fd637b
+5 -5
View File
@@ -20,7 +20,10 @@
}, },
'_fetch': async (rest_url, request_options) => { '_fetch': async (rest_url, request_options) => {
// noinspection JSUnresolvedVariable // noinspection JSUnresolvedVariable
let response = await MyFetch._pureFetch(rest_url, request_options) let response = await MyFetch._pureFetch(rest_url, request_options).catch(err => {
console.error(err)
return null
})
if (!response.ok) { if (!response.ok) {
throw new Error('Fail!') throw new Error('Fail!')
} }
@@ -40,10 +43,7 @@
}, },
'_pureFetch': async (rest_url, request_options) => { '_pureFetch': async (rest_url, request_options) => {
// noinspection JSUnresolvedVariable // noinspection JSUnresolvedVariable
return await fetch(env.API_URL + rest_url, request_options).catch(err => { return await fetch(env.API_URL + rest_url, request_options)
console.error(err)
return null
})
} }
} }