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

Uninformative stack traces #4

Open
wryun opened this issue Feb 5, 2015 · 2 comments
Open

Uninformative stack traces #4

wryun opened this issue Feb 5, 2015 · 2 comments

Comments

@wryun
Copy link

wryun commented Feb 5, 2015

Perhaps something like:

https://github.com/laverdet/node-fibers/blob/master/future.js#L195

would help?

@jtblin
Copy link
Owner

jtblin commented Feb 7, 2015

Thanks for the suggestion. Do you have an example of what you mean by the stack trace is uninformative?

@wryun
Copy link
Author

wryun commented Feb 10, 2015

syncho vs futures:

var Sync = require('syncho');
var obj = {
  asyncError: function (text, cb) {
    process.nextTick(function() {
      cb(new Error('argh'));
    });
  }
};  

Sync(function (){
  try {
    obj.asyncError.sync(null, 'Hello!');
  } catch (e) {
    console.log(e.stack);
  } 
});

var Future = require('fibers/future');
obj = Future.wrap(obj);
Future.task(function () {
  try {
    obj.asyncErrorFuture('Hello').wait();
  } catch (e) {
    console.log(e.stack);
  }
}).detach();

output:

Error: argh
    at /Users/jhaggerty/a/other/synchotest/test2.js:5:10
    at process._tickCallback (node.js:442:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:929:3
Error: argh
    at Object.Future.wait (/Users/jhaggerty/a/other/synchotest/node_modules/fibers/future.js:398:15)
    at /Users/jhaggerty/a/other/synchotest/test2.js:22:35
    at /Users/jhaggerty/a/other/synchotest/node_modules/fibers/future.js:416:21
    - - - - -
    at /Users/jhaggerty/a/other/synchotest/test2.js:5:10
    at process._tickCallback (node.js:442:13)
    at Function.Module.runMain (module.js:499:11)
    at startup (node.js:119:16)
    at node.js:929:3

Note that we see the critical line 22 in futures, whereas in syncho we only see the stack processing the tickCallback.

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