Skip to content

Commit

Permalink
fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Sep 3, 2021
1 parent 77a5915 commit 24bb017
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/plugins/data/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export {
IndexPattern,
IndexPatternsService,
IndexPatternsService as IndexPatternsCommonService,
DataView,
} from '../common';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import type { RequestHandler, RouteMethod, RequestHandlerContext } from 'src/core/server';
import { ErrorIndexPatternNotFound } from '../../error';
import { SavedObjectNotFound } from '../../../../../kibana_utils/common';

interface ErrorResponseBody {
message: string;
Expand Down Expand Up @@ -51,7 +52,9 @@ export const handleErrors = <
}

const is404 =
(error as ErrorIndexPatternNotFound).is404 || (error as any)?.output?.statusCode === 404;
(error as ErrorIndexPatternNotFound).is404 ||
(error as any)?.output?.statusCode === 404 ||
error instanceof SavedObjectNotFound;

if (is404) {
return response.notFound({
Expand Down

0 comments on commit 24bb017

Please sign in to comment.