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

uncaught errors should be printed to stderr, not stdout #196

Open
boneskull opened this issue Mar 12, 2019 · 6 comments
Open

uncaught errors should be printed to stderr, not stdout #196

boneskull opened this issue Mar 12, 2019 · 6 comments

Comments

@boneskull
Copy link
Collaborator

boneskull commented Mar 12, 2019

Here: https://github.com/mantoni/mochify.js/blob/master/lib/chromium.js#L141

Mochify prints uncaught errors to stdout. It should print these to stderr (which is what Mocha does).

@mantoni Any reason not to do this?

Unclear if the code at https://github.com/mantoni/mochify.js/blob/master/lib/chromium.js#L154 should also do this.

@boneskull
Copy link
Collaborator Author

It could be argued Mocha should print these to stdout, but that's how it works right now.

@mantoni
Copy link
Owner

mantoni commented Mar 12, 2019

Hmm. Can’t think of a good reason right now. I might have been lazy 😄

@mantoni
Copy link
Owner

mantoni commented Mar 13, 2019

There is one problem with having two output streams: The output is buffered partially to detect stack traces and map them back to the original source location using sourcemaps. Therefore it could happen that the outputs of the two streams are misleading, because there might be an offset.

@boneskull
Copy link
Collaborator Author

offset meaning incorrect stack trace, or do you mean interleaving? don't understand

@mantoni
Copy link
Owner

mantoni commented Mar 13, 2019

The one stream might be flushed while the other is still buffered. This could mean that you see a stack trace in the wrong place.

@boneskull
Copy link
Collaborator Author

possible to just buffer both?

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

2 participants