Stack Trace Info

23 views
Skip to first unread message

Jonathon Choo

unread,
Dec 15, 2015, 6:09:15 AM12/15/15
to bluebird
The code produces an error

var Promise = require('bluebird');
var fs = require('fs');

Promise.promisifyAll(fs);

fs.readFileAsync('file.json')
.then(hello)
.catch(function (e) {
  console.error(e);
});

function hello() {
  return 1 + y;
}

It returns "[ReferenceError: y is not defined]"

Its fairly obvious where and why the error is happening, but is there anyway
to get a stack trace, line number or the name of function that the code fails at?

Pradip Mukhopadhyay

unread,
Dec 15, 2015, 6:56:02 AM12/15/15
to Jonathon Choo, bluebird
--pradip



--
You received this message because you are subscribed to the Google Groups "bluebird" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bluebird-js...@googlegroups.com.
To post to this group, send email to blueb...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bluebird-js/c3adcbff-52bf-4341-9219-df70ffa15f0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages