Skip to content

Commit

Permalink
ensure fleetfilenotfound is reported as a 404
Browse files Browse the repository at this point in the history
  • Loading branch information
pzl committed Aug 24, 2023
1 parent 79303c2 commit 2840c31
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -30,7 +31,7 @@ export const errorHandler = <E extends Error>(
});
}

if (error instanceof NotFoundError) {
if (error instanceof NotFoundError || error instanceof FleetFileNotFound) {
return res.notFound({ body: error });
}

Expand Down

0 comments on commit 2840c31

Please sign in to comment.