Open nchaulet opened 4 hours ago
We still have some missing error handling in our Fleet route handler, this could cause issue with some errors not mapped to the proper status code (unexpected 500 for known errors for example)
For example if an error happen here https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts#L311-L317
We already have a custom router calling our handler, so it will be easy to wrap that call https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/server/services/security/fleet_router.ts#L84 and made all the error go to our fleet error handler.
Pinging @elastic/fleet (Team:Fleet)
Description
We still have some missing error handling in our Fleet route handler, this could cause issue with some errors not mapped to the proper status code (unexpected 500 for known errors for example)
For example if an error happen here https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/server/routes/package_policy/handlers.ts#L311-L317
Proposed solution
We already have a custom router calling our handler, so it will be easy to wrap that call https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/server/services/security/fleet_router.ts#L84 and made all the error go to our fleet error handler.