Commit 1067cbb3 authored by analog-nico's avatar analog-nico
Browse files

Quick fix for issue #36

parent a9abd066
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
'use strict';
'use strict';


var Bluebird = require('./bluebird-fresh.js'),
var Bluebird = require('./bluebird-fresh.js'),
    printRejectionReason = require('./bluebird-captured-trace-fresh.js').possiblyUnhandledRejection,
    printRejectionReason = require('./bluebird-captured-trace-fresh.js').formatAndLogError,
    _ = require('lodash'),
    _ = require('lodash'),
    chalk = require('chalk');
    chalk = require('chalk');


@@ -155,7 +155,7 @@ request.Request.prototype.promise = function RP$promise() {
Bluebird.onPossiblyUnhandledRejection(function (reason, promise) {
Bluebird.onPossiblyUnhandledRejection(function (reason, promise) {
    // For whatever reason we don't see _rp_in_use here at all after then is called. --> We compare to false instead of true.
    // For whatever reason we don't see _rp_in_use here at all after then is called. --> We compare to false instead of true.
    if (promise._rp_in_use !== false) {
    if (promise._rp_in_use !== false) {
        printRejectionReason(reason);
        printRejectionReason(reason, 'Possibly unhandled ');
    }
    }
    // else: The user did not call .then(...)
    // else: The user did not call .then(...)
    // --> We need to assume that this request is processed with a callback or a pipe etc.
    // --> We need to assume that this request is processed with a callback or a pipe etc.