medikoo / deferred

Modular and fast Promises implementation for JavaScript
ISC License
364 stars 20 forks source link

No file name, line number or stack trace during error #41

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hello -

When using done(), during an error I am not getting any file name, line number or stack trace, just the error message. For example,

doSomething.then(function(result) {
    console.log(result);
}).done(function(result) {
    console.log(result)
}, function(err) {
    console.error(err);
});

If an error occurs, I only get the following printed to the console:

[TypeError: Object prototype may only be an Object or null]

There are no other parameters sent to this function.

Is there anyway to obtain the file name, line number and stack trace of the error?

Thank you, Andrew Schools

medikoo commented 9 years ago

Stack trace is accessible on error.stack property (it's how native JavaScript API work)

ghost commented 9 years ago

Thank you.