mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-24 02:13:43 +03:00
Handle unsuccessful statuses
This commit is contained in:
parent
739de3d4eb
commit
0a8aaea75b
|
@ -83,6 +83,10 @@ export default function getApp(theState) {
|
|||
const [comments, etag] = await fetch(
|
||||
ghUrl,
|
||||
params
|
||||
).then(
|
||||
(res) => !( res.status >= 200 && res.status < 300 || res.status === 304 )
|
||||
? Promise.reject(new Error(`Полечен ответ с неудачным кодом ${res.status}.`))
|
||||
: res
|
||||
).then(
|
||||
(res) => Promise.all([
|
||||
res.status !== 304 ? res.json() : false,
|
||||
|
|
Loading…
Reference in New Issue
Block a user