Express.js sending response in promise .catch() error

后端 未结 0 350
栀梦
栀梦 2021-02-07 04:37

I have a function that looks like this:

function x(req, res, next){

    await doSomething().catch(error =>{

        return res.send(\'error here\'})

                


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题