ybogdanov / node-sync

Write simple and readable synchronous code in nodejs using fibers
MIT License
492 stars 70 forks source link

Error Logging #13

Closed ghost closed 12 years ago

ghost commented 12 years ago

I am just wondering if there is a way to log errors in a Sync just like in the native JavaScript environment. Thank you.

ybogdanov commented 12 years ago

just like in the native JavaScript environment

for example?

ghost commented 12 years ago

Yes, for example this line of code in native javascript:

function nativeJavascript() { var foo = 49; console.log(foo1); } ->Error: ReferenceError: foo1 is not defined

In node sync, no error like this is logged. Instead, I get a blanc error object {} on the callback with no information about the error type or error line. This ends up being hard to debug large functions. Is it possible to get more info about the error that occurred on the callback?

Thanks for your help

ybogdanov commented 12 years ago

It should not behave like this. Which version of node-sync/fibers/nodejs do you use? And please, give me a peace of code reproducing this bug.

ghost commented 12 years ago

I reinstalled this module and the problem actually disappeared. I was using version 0.2.0.