From 2840c31646e81211303c94f42774188c14dba5f6 Mon Sep 17 00:00:00 2001 From: pzl Date: Thu, 24 Aug 2023 11:10:05 -0400 Subject: [PATCH] ensure fleetfilenotfound is reported as a 404 --- .../security_solution/server/endpoint/routes/error_handler.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/error_handler.ts b/x-pack/plugins/security_solution/server/endpoint/routes/error_handler.ts index 9b6de8ac0b6e0..da1ecf9ca5911 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/error_handler.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/error_handler.ts @@ -6,6 +6,7 @@ */ import type { IKibanaResponse, KibanaResponseFactory, Logger } from '@kbn/core/server'; +import { FleetFileNotFound } from '@kbn/fleet-plugin/server/errors'; import { CustomHttpRequestError } from '../../utils/custom_http_request_error'; import { NotFoundError } from '../errors'; import { EndpointHostUnEnrolledError } from '../services/metadata'; @@ -30,7 +31,7 @@ export const errorHandler = ( }); } - if (error instanceof NotFoundError) { + if (error instanceof NotFoundError || error instanceof FleetFileNotFound) { return res.notFound({ body: error }); }