来自版本7的Node.js具有async/await语法糖用于处理promises,现在在我的代码中经常出现以下警告:
(node:11057) UnhandledPromiseRejectionWarning: Unhandled promise
rejection (rejection id: 1): ReferenceError: Error: Can't set headers
after they are sent.
(node:11057) DeprecationWarning: Unhandled promise rejections are
deprecated. In the future, promise rejections that are not handled
will terminate the Node.js process with a non-zero exit code.
Run Code Online (Sandbox Code Playgroud)
不幸的是,没有提到缺少捕获的线.有没有办法找到它而不检查每个try/catch块?