Closed
Description
Replaces: #51585
Relates: elastic/kibana#55255
There are cases where the ApiKeyService and TokenService throw exceptions if they are disabled (e.g. you cannot list API Keys, or create an API Key if the service is disabled).
In these cases we should add a metadata field to the thrown exception (e.g. "es.disabled.feature" : "API-Key-Service"
) so that consumers of the REST API can detect this root cause without needing to parse error messages.