You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, in the Routes implementation, we have the following code as an example
serviceRouter.post('/',(req,res,next)=>{logger.info('Service post message received');try{post(req,res);}catch(error){next(error);}});
The post function being called is usually an async function, therefore if an error occurs during its execution, we won't be able to catch those errors in the catch method as it is.
Therefore I suggest we modify the code to catch async errors like this
serviceRouter.post('/',async(req,res,next)=>{logger.info('Service post message received');try{awaitpost(req,res);}catch(error){next(error);}});
This change needs to be implemented for all connect applications and both for js and ts code.
The text was updated successfully, but these errors were encountered:
Currently, in the Routes implementation, we have the following code as an example
The post function being called is usually an async function, therefore if an error occurs during its execution, we won't be able to catch those errors in the catch method as it is.
Therefore I suggest we modify the code to catch async errors like this
This change needs to be implemented for all connect applications and both for js and ts code.
The text was updated successfully, but these errors were encountered: