elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.81k stars 8.2k forks source link

[Fleet] Missing fleet error handling in our handler #197518

Open nchaulet opened 4 hours ago

nchaulet commented 4 hours ago

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.

elasticmachine commented 4 hours ago

Pinging @elastic/fleet (Team:Fleet)