79074589

Date: 2024-10-10 13:23:56
Score: 0.5
Natty:
Report link

It will be caused by using try catch with await inside of your callback for your middleware. You can either use a self invoked function like in the answer from @Andrew or you can handle it aswell like this:

// Sample route to trigger HttpClientError
app.get('/httpclient-error', (): void => {
    axios.get(`${BASE_URL}/notFound`)
        .then(() => {
            // handle successful response
        })
        .catch((e: AxiosError) => {
            throw new HttpClientError(errorMessage, e)
        })
})
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Andrew
  • Low reputation (0.5):
Posted by: CyberT33N