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

Please throw actual Errors, not strings #38

Open
axefrog opened this issue Sep 17, 2012 · 2 comments
Open

Please throw actual Errors, not strings #38

axefrog opened this issue Sep 17, 2012 · 2 comments

Comments

@axefrog
Copy link

axefrog commented Sep 17, 2012

When step throws an exception, it just throws the string, rather than an actual Error object. This is bad because when an error is thrown, there is no stack trace to work with, so it's difficult to figure out the source of the error.

throw new Error('whatever');
@bminer
Copy link

bminer commented Nov 14, 2012

@axefrog - Are you sure that only the String is returned?

Checkout this test. It looks like the Error object is passed, not just a string.

Thoughts?

@dotnetCarpenter
Copy link

According to this article throw 'string errordoes not provide the same info as throw new Error("error string")

A String is not an Error - http://www.devthought.com/2011/12/22/a-string-is-not-an-error/

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

3 participants