chore: try to log error causes

This commit is contained in:
WebStreamr 2025-06-03 14:45:07 +00:00
parent b94f9898b0
commit f6967da5cc
No known key found for this signature in database
2 changed files with 8 additions and 4 deletions

View file

@ -61,7 +61,9 @@ export class ExtractorRegistry {
};
}
this.logger.warn(`${extractor.id} error: ${error}`, ctx);
const cause = (error as Error & { cause?: unknown }).cause;
this.logger.warn(`${extractor.id} error: ${error}, cause: ${cause}`, ctx);
return undefined;
}

View file

@ -36,8 +36,8 @@ export class StreamResolver {
this.logger.info(`${handler.id} returned ${handlerUrlResults.length} urls`, ctx);
urlResults.push(...(handlerUrlResults.filter(handlerUrlResult => handlerUrlResult !== undefined)));
} catch (err) {
if (err instanceof NotFoundError) {
} catch (error) {
if (error instanceof NotFoundError) {
return;
}
@ -47,7 +47,9 @@ export class StreamResolver {
ytId: 'E4WlUXrJgy4',
});
this.logger.error(`${handler.id} error: ${err}`, ctx);
const cause = (error as Error & { cause?: unknown }).cause;
this.logger.error(`${handler.id} error: ${error}, cause: ${cause}`, ctx);
}
});
await Promise.all(handlerPromises);