2016-03-15 15:21:55 +03:00
|
|
|
/**
|
2018-09-12 01:27:47 +03:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2016-03-15 15:21:55 +03:00
|
|
|
*
|
2018-02-17 05:24:55 +03:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2016-03-15 15:21:55 +03:00
|
|
|
*
|
2018-05-11 05:06:46 +03:00
|
|
|
* @format
|
2016-03-15 15:21:55 +03:00
|
|
|
* @flow
|
|
|
|
*/
|
2018-05-11 05:06:46 +03:00
|
|
|
|
2016-11-21 04:49:21 +03:00
|
|
|
'use strict';
|
2016-03-15 15:21:55 +03:00
|
|
|
|
2019-05-08 18:44:25 +03:00
|
|
|
require('./Promise'); // make sure the default rejection handler is installed
|
2016-03-15 15:21:55 +03:00
|
|
|
const rejectionTracking = require('promise/setimmediate/rejection-tracking');
|
|
|
|
|
|
|
|
module.exports = () => {
|
|
|
|
rejectionTracking.enable({
|
|
|
|
allRejections: true,
|
|
|
|
onUnhandled: (id, error) => {
|
|
|
|
console.error(error);
|
|
|
|
},
|
|
|
|
onHandled: () => {},
|
|
|
|
});
|
|
|
|
};
|