Checking result status rather than ok for imgur methods.
This commit is contained in:
@@ -10,7 +10,7 @@ function imgurAlbum(post) {
|
||||
'Authorization': `Client-ID ${config.methods.imgur.clientId}`
|
||||
}
|
||||
}).then(res => res.json()).then(res => {
|
||||
if(!res.ok) {
|
||||
if(res.status !== 200) {
|
||||
throw new Error(`Could not fetch info for imgur album '${post.host.id}': ${res.data.error}`);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ function imgurImage(post) {
|
||||
'Authorization': `Client-ID ${config.methods.imgur.clientId}`
|
||||
}
|
||||
}).then(res => res.json()).then(res => {
|
||||
if(!res.ok) {
|
||||
if(res.status !== 200) {
|
||||
throw new Error(`Could not fetch info for imgur image '${post.host.id}': ${res.data.error}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user