When I write promise
in variable, I am getting unhandled rejection
:
'use strict';
const Promise = require('bluebird');
const p = Promise.reject(new Error('qwerty'));
Unhandled rejection Error: qwerty at Object.
but when I'm doing the same thing with q
, error is not thrown:
'use strict';
const q = require('q');
const p = q.reject(new Error('qwerty'));
Why does Promise.reject
in bluebird work this way? I can't find information in documentation about this behavior.