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

Fix panic on invalid browser type option #905

Merged
merged 2 commits into from
May 24, 2023
Merged

Conversation

ka3de
Copy link
Collaborator

@ka3de ka3de commented May 24, 2023

Description of changes

This PR fixes an issue present since merging #876 due to which execution panicked if the scenario.options.browser.type option was unset or invalid (see this comment's second point). It also improves the error handling from our Go logic, delegating the error to the mapping layer.

Closes #894.

Checklist

Tasks

ka3de added 2 commits May 24, 2023 10:39
Instead this commit changes the API for these methods in order to return
an error that must be parsed from the mapping layer.
Now that launch method does not panic, we have to verify the returned
error from the Goja execution.
@ka3de ka3de self-assigned this May 24, 2023
@ka3de ka3de requested review from ankur22 and inancgumus May 24, 2023 09:07
Copy link
Collaborator

@ankur22 ankur22 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for tidying up the error handling for these methods 👍

Copy link
Member

@inancgumus inancgumus left a comment

Choose a reason for hiding this comment

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

Nice 👍

@ka3de ka3de merged commit bdf80e5 into main May 24, 2023
@ka3de ka3de deleted the fix/panic-browser-type-opt branch May 24, 2023 13:54
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.

Broken since merge of https://github.com/grafana/xk6-browser/pull/876
3 participants