creationix/step

Please throw actual Errors, not strings

Opened this issue · 2 comments

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');

@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?

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/