Closed vprintempsPei closed 2 weeks ago
Hi @vprintempsPei , thanks for this PR. I looked into it and I feel like this shouldn't be needed. There can be different kinds of exception when loading an Endpoint (either EndpointError or ServiceExceptionError) and any of them can be returned. If there's no http code, then maybe it's because the error is not an HTTP error?
Thank you for raising this issue, indeed there was a problem where the specialized error types were reset in certain scenario! I created a bigger PR to address this and also improve the test coverage of that part.
Currently the error on endpoint only returns a message, and then the following
console.log(error.httpStatus)
returnsundefined
:This behavior is due to the following line in
eventHandler
(utils.ts):It can be fixed as follows:
This pull request aims to return an error object that contains the error message in
error.message
and all other error information likehttpStatus
. Tests have been updated accordingly.Let me know if i need to change/fix anything in the PR as i don't understand very well the eventHandler function