NestJs 中是否存在一些类似于 express-async-errors 的东西,以避免我们在每个异步函数中编写 try catch?
there exists in NestJs some similar to express-async-errors to save us from writing try catch in each asynchronous function?
过去,当我只在 express 中做我的应用程序时,我使用 express-async-errors 模块来避免编写 catch-try 块。
NestJs有类似的方法吗?
看来您需要使用异常过滤器 https://docs.nestjs.com/exception-filters
过去,当我只在 express 中做我的应用程序时,我使用 express-async-errors 模块来避免编写 catch-try 块。
NestJs有类似的方法吗?
看来您需要使用异常过滤器 https://docs.nestjs.com/exception-filters