Created
March 15, 2019 07:12
-
-
Save zzuhan/0ce9c2a5b449b89a6e3d6151b220d084 to your computer and use it in GitHub Desktop.
[error-handle] nodejs的错误处理 #nodejs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
process.on('uncaughtException', onFatal); | |
// 未处理的process的reject | |
process.on('unhandledRejection', onFatal); | |
return require('co')(function* () { | |
yield start() | |
}).catch(onFatal); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment