Commit 44534ac3 authored by Tobias Steiner's avatar Tobias Steiner
Browse files

Change errorhandling. Do not fail

parent 3af9064e
Pipeline #3131 passed with stage
in 2 minutes and 43 seconds
......@@ -57,9 +57,15 @@ export class ResponseCollector {
if(Array.isArray(data.data.links)) {
data.data.links = await Promise.all(data.data.links.map(async (d) => {
const a = {};
const provider = await UrlResolver.getProvider(d, this.language);
a[provider] = d;
return a;
try {
const provider = await UrlResolver.getProvider(d, this.language);
a[provider] = d;
return a;
} catch(error) {
console.log(`error getting provider` + error);
a['unknown'] = d;
return a;
}
}));
}
if(Array.isArray(this.finalData.data[data.name])) {
......
......@@ -18,7 +18,8 @@ class UrlResolver {
console.log(`Could not resolve (404) url ${url}`);
return 'unknown';
}
throw new Error(`Could not resolve (${err.response.status}) url ${url}`);
console.log(`Could not resolve (${err.response.status}) url ${url}`);
return 'unknown';
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment