Skip to content

Instantly share code, notes, and snippets.

@zzuhan
Created March 15, 2019 07:12
Show Gist options
  • Save zzuhan/0ce9c2a5b449b89a6e3d6151b220d084 to your computer and use it in GitHub Desktop.
Save zzuhan/0ce9c2a5b449b89a6e3d6151b220d084 to your computer and use it in GitHub Desktop.
[error-handle] nodejs的错误处理 #nodejs
//
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