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

Errors should be on by default and output stack trace #28

Open
m-a-r-c-e-l-i-n-o opened this issue May 20, 2016 · 4 comments
Open

Errors should be on by default and output stack trace #28

m-a-r-c-e-l-i-n-o opened this issue May 20, 2016 · 4 comments

Comments

@m-a-r-c-e-l-i-n-o
Copy link
Contributor

m-a-r-c-e-l-i-n-o commented May 20, 2016

To make debugging more convenient (especially for the CLI), I think it would be beneficial to add console.error calls by default. Basically switching every occurrence of errCallback(ex) to
if (typeof errCallback === 'function') { errCallback(ex) } else { console.error(ex.stack) } (Assuming the default for errCallback is changed to undefined.)

@joeldenning
Copy link
Contributor

Yeah this is sort of a pain point in the code right now. The tricky part with it is that Promises make error handling pretty tricky because if you throw an error it doesn't always cause the nodejs process to die and exit. And since we're using a lot of Promises with SystemJS, we'd just have to take that into account.

@m-a-r-c-e-l-i-n-o
Copy link
Contributor Author

m-a-r-c-e-l-i-n-o commented May 20, 2016

@joeldenning I'm guessing you are talking about the more general problem of handling async exceptions? That could be addressed without major hassle, but quite frankly, some extensive refactoring with unit tests would be ideal, and I feel like these runTests and importTestFiles functions could really use some breaking down with better error handling. I'm working on a simple node-jasmine-coverage solution, which we could use to unit test this thing and refactor. I need this project to be a little more predictable/easier-to-debug, I intend to use it quite a bit.

@joeldenning
Copy link
Contributor

Agreed. What started as a pet-project is getting more and more important for my workflow as well. I think a refactoring + tests is in order.

@joeldenning
Copy link
Contributor

Maybe after #27 is merged in we can start doing a series of small refactoring prs.

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