Accounting for actualid_d.jpg imgur pattern. Added debug argument to print full stack trace on error.

This commit is contained in:
2018-07-05 23:27:11 +02:00
parent 2cc15eecd0
commit 160ee9711d
4 changed files with 30 additions and 21 deletions

View File

@@ -9,7 +9,7 @@ async function imgurAlbum(post) {
const html = await res.text();
if (res.status !== 200) {
throw new Error(`Could not fetch info for imgur image '${post.host.id}': '${res.data.error}'`);
throw new Error(`Could not fetch info for imgur image '${post.host.id}': '${res.statusText}'`);
}
const dataString = html.replace(/\s+/g, ' ').match(/}}, item:(.*)}; var PREBID_TIMEOUT/)[1];

View File

@@ -7,7 +7,7 @@ async function imgurImage(post) {
const html = await res.text();
if (res.status !== 200) {
throw new Error(`Could not fetch info for imgur image '${post.host.id}': '${res.data.error}'`);
throw new Error(`Could not fetch info for imgur image '${post.host.id}': '${res.statusText}'`);
}
const dataString = html.replace(/\s+/g, ' ').match(/}}, item:(.*)}; var PREBID_TIMEOUT/)[1];