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

add stack trace for warnings https://github.com/petkaantonov/bluebird… #1553

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ Promise.prototype.then = function (didFulfill, didReject) {
if (arguments.length > 1) {
msg += ", " + util.classString(didReject);
}
msg += new Error().stack;
this._warn(msg);
}
return this._then(didFulfill, didReject, undefined, undefined, undefined);
Expand Down Expand Up @@ -158,7 +159,8 @@ Promise.prototype.toJSON = function () {

Promise.prototype.all = function () {
if (arguments.length > 0) {
this._warn(".all() was passed arguments but it does not take any");
this._warn(".all() was passed arguments but it does not take any "
+ new Error().stack);
}
return new PromiseArray(this).promise();
};
Expand Down Expand Up @@ -498,6 +500,7 @@ function(reason, synchronous, ignoreNonErrorWarnings) {
if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) {
var message = "a promise was rejected with a non-error: " +
util.classString(reason);
message += new Error().stack;
this._warn(message, true);
}
this._attachExtraTrace(trace, synchronous ? hasStack : false);
Expand Down