You can see that even in the handler export I'm trying to return a 500 as a test and even that doesn't come through. The only error I ever get from the backend is Error: {"status":502,"body":"{\"message\": \"Internal server error\"}"} whenever I throw an error from "exampleRoutes".
Hi,
I'm running into a problem where my app.use(errorHandler) isn't catching any of the thrown errors. From what I've read online (https://stackoverflow.com/questions/56429705/send-custom-error-message-with-serverless-http-express) and (https://stackoverflow.com/questions/46689554/whats-the-correct-way-of-returning-http-error-codes-in-serverless-lambda/46697547#46697547), it seems like it may be due to the way API Gateway handles errors.
Here's an example of my code.
You can see that even in the handler export I'm trying to return a 500 as a test and even that doesn't come through. The only error I ever get from the backend is
Error: {"status":502,"body":"{\"message\": \"Internal server error\"}"}
whenever I throw an error from "exampleRoutes".