chore: use source baseUrl for source errors
This commit is contained in:
parent
b94c539269
commit
c81f17a19a
2 changed files with 8 additions and 8 deletions
|
|
@ -41,17 +41,17 @@ export class StreamResolver {
|
|||
|
||||
let handlerErrorOccurred = false;
|
||||
const urlResults: UrlResult[] = [];
|
||||
const handlerPromises = sources.map(async (handler) => {
|
||||
if (!handler.contentTypes.includes(type)) {
|
||||
const handlerPromises = sources.map(async (source) => {
|
||||
if (!source.contentTypes.includes(type)) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const handleResults = await handler.handle(ctx, type, id);
|
||||
this.logger.info(`${handler.id} returned ${handleResults.length} urls`, ctx);
|
||||
const sourceResults = await source.handle(ctx, type, id);
|
||||
this.logger.info(`${source.id} returned ${sourceResults.length} urls`, ctx);
|
||||
|
||||
const handlerUrlResults = await Promise.all(
|
||||
handleResults.map(({ countryCode, title, url }) => this.extractorRegistry.handle(ctx, url, countryCode, title)),
|
||||
sourceResults.map(({ countryCode, title, url }) => this.extractorRegistry.handle(ctx, url, countryCode, title)),
|
||||
);
|
||||
|
||||
urlResults.push(...handlerUrlResults.flat());
|
||||
|
|
@ -64,8 +64,8 @@ export class StreamResolver {
|
|||
|
||||
streams.push({
|
||||
name: envGetAppName(),
|
||||
title: [`🔗 ${handler.label}`, logErrorAndReturnNiceString(ctx, this.logger, handler.id, error)].join('\n'),
|
||||
externalUrl: ctx.hostUrl.href,
|
||||
title: [`🔗 ${source.label}`, logErrorAndReturnNiceString(ctx, this.logger, source.id, error)].join('\n'),
|
||||
externalUrl: source.baseUrl,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -463,7 +463,7 @@ exports[`resolve returns source errors as stream 1`] = `
|
|||
{
|
||||
"streams": [
|
||||
{
|
||||
"externalUrl": "http://localhost/",
|
||||
"externalUrl": "https://meinecloud.click",
|
||||
"name": "WebStreamr",
|
||||
"title": "🔗 MeineCloud
|
||||
❌ Request failed. Request-id: test.",
|
||||
|
|
|
|||
Loading…
Reference in a new issue