Promise对象触发了reject&同时存在一个handled方法(Promise.catch())来处理reject的时候,会emit一个rejectionHandled事件,
如果不存在handled方法,则触发'unhandledRejection' 事件
异步代码中,未处理的reject的list增加时emit的unhandledRejection事件,
展开原码无callback函数时,nodejs默认将打印异常的stack trace给stderr然后退出。
同步代码中,未处理异常list增加的时候会发出uncaughtException事件
In synchronous code, the 'uncaughtException' event is emitted when the list of unhandled exceptions grows.
In asynchronous code, the 'unhandledRejection' event is emitted when the list of unhandled rejections grows, and the 'rejectionHandled' event is emitted when the list of unhandled rejections shrinks.