mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Security Solution] update es connection error code placeholder (#143712)
This commit is contained in:
parent
d108b48d6f
commit
e01b6bd5b6
3 changed files with 9 additions and 2 deletions
|
@ -79,3 +79,7 @@ export const failedFleetActionErrorCode = '424';
|
|||
|
||||
export const ENDPOINT_DEFAULT_PAGE = 0;
|
||||
export const ENDPOINT_DEFAULT_PAGE_SIZE = 10;
|
||||
|
||||
export const ENDPOINT_ERROR_CODES: Record<string, number> = {
|
||||
ES_CONNECTION_ERROR: -272,
|
||||
};
|
||||
|
|
|
@ -17,6 +17,7 @@ import type {
|
|||
import { FleetServerAgentComponentStatuses, AGENTS_INDEX } from '@kbn/fleet-plugin/common';
|
||||
import moment from 'moment';
|
||||
import { BaseDataGenerator } from './base_data_generator';
|
||||
import { ENDPOINT_ERROR_CODES } from '../constants';
|
||||
|
||||
// List of computed (as in, done in code is kibana via
|
||||
// https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/common/services/agent_status.ts#L13-L44
|
||||
|
@ -91,7 +92,7 @@ export class FleetAgentGenerator extends BaseDataGenerator<Agent> {
|
|||
componentStatus === 'failed'
|
||||
? {
|
||||
error: {
|
||||
code: 123,
|
||||
code: ENDPOINT_ERROR_CODES.ES_CONNECTION_ERROR,
|
||||
message: 'Unable to connect to Elasticsearch',
|
||||
},
|
||||
}
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import type { DocLinks } from '@kbn/doc-links';
|
||||
|
||||
import { ENDPOINT_ERROR_CODES } from '../../../../common/endpoint/constants';
|
||||
|
||||
type PackageActions = 'es_connection' | 'policy_failure';
|
||||
|
||||
export const titles = Object.freeze(
|
||||
|
@ -93,7 +95,7 @@ export class PackageActionFormatter {
|
|||
}
|
||||
|
||||
private getKeyFromErrorCode(code: number): PackageActions {
|
||||
if (code === 123) {
|
||||
if (code === ENDPOINT_ERROR_CODES.ES_CONNECTION_ERROR) {
|
||||
return 'es_connection';
|
||||
} else if (code === 124) {
|
||||
return 'policy_failure';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue