Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

link extraction promise cleanup: #701

Merged
merged 1 commit into from
Oct 11, 2024
Merged

Conversation

ikreymer
Copy link
Member

@ikreymer ikreymer requested a review from tw4l October 10, 2024 16:58
Copy link
Member

@tw4l tw4l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, one question about where we're catching and logging the errors being thrown that's not a showstopper but maybe worth thinking about a bit

@@ -38,8 +40,8 @@ export function timedRun(
//logger.error("Unknown exception", {...errJSON(err), ...logDetails}, context);
throw err;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we have a few uses of timedRun that aren't wrapped in a tightly scoped try/catch block (e.g. setting page title in the crawlPage method, running behaviors) but rather a higher-level one in the worker that will catch and log a "Worker Exception". I'm wondering if we might want to log the error closer to where it occurs or append some contextual information to the error message to help debug when something goes wrong?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, i think that this should still catch the original error, but maybe worth another look.
This was removed to avoid redundancy error message - if the timedRun() throws, its not a timeout, but an actual exception that probably should interrupt the crawling of that page...

@ikreymer ikreymer merged commit 652cf9c into main Oct 11, 2024
4 checks passed
@ikreymer ikreymer deleted the link-extract-promise-improve branch October 11, 2024 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Puppeteer errors causing program termination
2 participants