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

feat(cdp): better logging of fetch failures #25665

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oliverb123
Copy link
Contributor

The cyclotron worker provides a bunch of information we don't bubble up to users, this makes debugging harder and doesn't spark joy. This PR is an attempt to fix that

plugin-server/src/cdp/hog-executor.ts Show resolved Hide resolved
Comment on lines 122 to +126
resParams.response = {
status: fetchResponse.status,
body: responseBody,
headers: Object.fromEntries(fetchResponse.headers.entries()),
}
resParams.body = responseBody
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't fully get why body moved one level higher. It's still part of the response, no? I do see this is used for internal housekeeping and not directly exposed to the users, so it's probably fine, but this misdirection still confuses me. Why not just keep the erroring response/body also in the same object?

In any case, I'm not too opinionated on this small remark, just though it's worth bringing up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The body is a level higher because even in failure cases it's possible to get a body back (some 500s or 400s get a body, those are "failed" fetches, but they might still have useful info for the user)

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.

2 participants