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

Throw error with stack trace when launching with an invalid executablePath option #750

Closed
austinkelleher opened this issue Sep 11, 2017 · 1 comment

Comments

@austinkelleher
Copy link
Contributor

When puppeteer is used as a dependency or sub-dependency of another project that exposes the puppeteer API, an invalid executablePath option should be reported appropriately. Currently, if an invalid executablePath is provided to puppeteer.launch(...), it is unclear where the actual error is coming from. It could be from any module. This error should be propagated with a stack trace directly from puppeteer. I have a fix for this and I will put up a PR momentarily.

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 0.11.0-alpha
  • Platform / OS version: macOS 10.12.6

What steps will reproduce the problem?

Please include code that reproduces the issue.

  1. await puppeteer.launch({ executablePath: 'random-path' })

What is the expected result?

An error containing a stack trace clearly describing the issue e.g.

Error: Error launching Chromium process with executable path "random-path"
    at fs.stat (/puppeteer/lib/Launcher.js:147:23)
    at FSReqWrap.oncomplete (fs.js:152:21)

What happens instead?

events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: spawn random-path ENOENT
    at exports._errnoException (util.js:1016:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:189:19)
    at onErrorNT (internal/child_process.js:366:16)
    at _combinedTickCallback (internal/process/next_tick.js:102:11)
    at process._tickCallback (internal/process/next_tick.js:161:9)
@austinkelleher
Copy link
Contributor Author

Fixed in: #751

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

No branches or pull requests

1 participant