feature-ui/eintrag-per-woche #23
@@ -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
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user