Prevent undefined error stack

If for some reason we do not get an error passed to this method ensure
that we cast it to an error
Merge pull request #265 from jenius/sjs/prevent-undefined-error-stack

Prevent undefined error stack