Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
背景
在目前 async/await + promise 的 Node 开发模式下,非
stream
/socket
基本不会出现uncaughtException
的问题,而对于stream
/socket
涉及到 fd 操作的错误,譬如:类似这种没有任何可回溯的有用堆栈信息的
uncaughtException
造成graceful
触发进程退出,反而会影响到主业务流程的状态。故此 PR 旨在支持上层开发者定义可忽略(即进程不退出)的错误码,当匹配到传入的
ignoreCode
配置错误码,graceful
只会输出原始的错误信息,而不会执行后续的退出逻辑。