diff --git a/common/constants/query_assist.ts b/common/constants/query_assist.ts index 8de10583d6..871f3cf5d0 100644 --- a/common/constants/query_assist.ts +++ b/common/constants/query_assist.ts @@ -12,4 +12,4 @@ export const QUERY_ASSIST_API = { export const ML_COMMONS_API_PREFIX = '/_plugins/_ml'; -export const ERROR_DETAILS = { GUARDRAILS_TRIGGERED: 'guardrail triggered' }; +export const ERROR_DETAILS = { GUARDRAILS_TRIGGERED: 'guardrails triggered' }; diff --git a/public/components/event_analytics/explorer/query_assist/input.tsx b/public/components/event_analytics/explorer/query_assist/input.tsx index a079cbfea0..02aa71fd8b 100644 --- a/public/components/event_analytics/explorer/query_assist/input.tsx +++ b/public/components/event_analytics/explorer/query_assist/input.tsx @@ -95,7 +95,6 @@ const prohibitedQueryCallOut = ( size="s" color="danger" iconType="alert" - dismissible /> ); @@ -106,7 +105,6 @@ const emptyQueryCallOut = ( size="s" color="warning" iconType="iInCircle" - dismissible /> ); @@ -117,7 +115,6 @@ const pplGenerated = ( size="s" color="success" iconType="check" - dismissible /> ); @@ -200,7 +197,7 @@ export const QueryAssistInput: React.FC> = (props } as Error; if ( error.body.statusCode === 400 && - error.body.message === ERROR_DETAILS.GUARDRAILS_TRIGGERED + error.body.message.includes(ERROR_DETAILS.GUARDRAILS_TRIGGERED) ) return new ProhibitedQueryError(error.body.message); return error.body as Error; diff --git a/server/routes/query_assist/routes.ts b/server/routes/query_assist/routes.ts index ae96cc6abf..2185045c31 100644 --- a/server/routes/query_assist/routes.ts +++ b/server/routes/query_assist/routes.ts @@ -84,7 +84,7 @@ export function registerQueryAssistRoutes(router: IRouter) { if ( isResponseError(error) && error.statusCode === 400 && - error.body.error.details === ERROR_DETAILS.GUARDRAILS_TRIGGERED + error.body.includes(ERROR_DETAILS.GUARDRAILS_TRIGGERED) ) { return response.badRequest({ body: ERROR_DETAILS.GUARDRAILS_TRIGGERED }); } @@ -156,7 +156,7 @@ export function registerQueryAssistRoutes(router: IRouter) { if ( isResponseError(error) && error.statusCode === 400 && - error.body.error.details === ERROR_DETAILS.GUARDRAILS_TRIGGERED + error.body.includes(ERROR_DETAILS.GUARDRAILS_TRIGGERED) ) { return response.badRequest({ body: ERROR_DETAILS.GUARDRAILS_TRIGGERED }); }