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

Stack traces of promisified function throwing asynchronous exception. #9

Closed
benjamingr opened this Issue Oct 8, 2013 · 4 comments

Comments

Projects
None yet
3 participants
@benjamingr
Collaborator

benjamingr commented Oct 8, 2013

Let's say I promisify a function like this:

function lol(err,cb){
   setTimeout(function(){
       setTimeout(function(){
           throw "lolwtf_I'mAString";
       },100);
      cb(null,"Haha")
   },100);
}

Bluebird does not handle the error, nor would I get a stack trace. Domains can be used here to provide better stack traces at least in debug builds.

http://chat.stackoverflow.com/transcript/message/12228569#12228569

@spion

This comment has been minimized.

Show comment
Hide comment
@spion

spion Oct 8, 2013

Collaborator

Currently domains have this warning:

http://nodejs.org/api/domain.html#domain_warning_don_t_ignore_errors

What should bluebird do with respect to that warning?

Collaborator

spion commented Oct 8, 2013

Currently domains have this warning:

http://nodejs.org/api/domain.html#domain_warning_don_t_ignore_errors

What should bluebird do with respect to that warning?

@petkaantonov

This comment has been minimized.

Show comment
Hide comment
@petkaantonov

petkaantonov Oct 8, 2013

Owner

Well, I am not currently considering this because:

  1. Cannot use this in any kind of production environment
  2. You would use it to debug 3rd party libraries that actually do that, while not on production. So you would have to know how to reproduce it anyway. So it is really low amount of utility for a lot of cost.
Owner

petkaantonov commented Oct 8, 2013

Well, I am not currently considering this because:

  1. Cannot use this in any kind of production environment
  2. You would use it to debug 3rd party libraries that actually do that, while not on production. So you would have to know how to reproduce it anyway. So it is really low amount of utility for a lot of cost.
@benjamingr

This comment has been minimized.

Show comment
Hide comment
@benjamingr

benjamingr Oct 8, 2013

Collaborator

@spion To be honest I don't expect bluebird to handle with this in practice. I wanted to see if people are interested in this.

As for the error, I'm not saying it should ignore the error ,just provide a decent stack trace.

Collaborator

benjamingr commented Oct 8, 2013

@spion To be honest I don't expect bluebird to handle with this in practice. I wanted to see if people are interested in this.

As for the error, I'm not saying it should ignore the error ,just provide a decent stack trace.

@benjamingr

This comment has been minimized.

Show comment
Hide comment
@benjamingr

benjamingr May 10, 2015

Collaborator

@petkaantonov Two years later, can/should we warn on callback called twice in 3.0?

Collaborator

benjamingr commented May 10, 2015

@petkaantonov Two years later, can/should we warn on callback called twice in 3.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment