-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Ingest Management] Remove/replace Boom errors in services #65837
Comments
Pinging @elastic/ingest-management (Team:Ingest Management) |
This refers to returning a Boom error in the API handlers. We can still use Boom we just need to handle them which we are doing. https://github.com/elastic/kibana/blob/master/src/core/MIGRATION_EXAMPLES.md#http-routes
|
That link refers to routes, which are "above" services. Maybe someone from @elastic/kibana-platform can clarify and offer some guidance? My understanding is using Boom in services means their consumers must also use it which is undesirable and preventable. |
The idea behind getting rid of I.E instead of having try {
const something = await myService.doSomethingRisky()
return response.ok({
body: something,
});
} catch (e) {
if(isMyNotFoundError(e)) {
return response.notFound();
}
return response.internalError();
} For the migration guide:
You can use |
(Removing release note labels as this is not a release-specific chore/tech debt issue.) |
Reopening this to track the the second phase of work from #66688 |
This is the second phase of work from #66688 which ensured consistent logging & return values
We can replace Boom with custom errors like
The legacy SO client is also a source of Boom errors. Instead of having our services transparently return the result (success or error) of the SO call, we should look for errors there and throw an error.
e.g.
throw new AgentEventNotFoundError(id)
ifsoClient.find<AgentEventSOAttributes>(id)
returns a Boom 404.Tracking
setup
agent_config
enrollment_api_key
agent
epm
datasource
data_streams
install_script
output
settings
app
original description
See https://github.com//issues/57458I've seen this sentiment (deprecate Boom, adopt NP http errors) in Slack and elsewhere.
I can look for something more official, but I think we should avoid new Boom usage and replace the existing ones.
The text was updated successfully, but these errors were encountered: