Skip to content

Commit

Permalink
remove unneeded changes, disable additional error check
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Sep 19, 2021
1 parent 0e07d02 commit f82d2bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
15 changes: 0 additions & 15 deletions src/plugins/data/common/data_views/data_views/data_views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,21 +420,6 @@ export class DataViewsService {
DATA_VIEW_SAVED_OBJECT_TYPE,
id
);
/*
let savedObject: SavedObject<DataViewAttributes>;
try {
savedObject = await this.savedObjectsClient.get<DataViewAttributes>(
DATA_VIEW_SAVED_OBJECT_TYPE,
id
);
} catch (e) {
throw new SavedObjectNotFound(
DATA_VIEW_SAVED_OBJECT_TYPE,
id,
'management/kibana/indexPatterns'
);
}
*/

if (!savedObject.version) {
throw new SavedObjectNotFound(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export const registerUpdateIndexPatternRoute = (
if (changeCount < 1) {
throw new Error('Index pattern change set is empty.');
}

await indexPatternsService.updateSavedObject(indexPattern);

if (doRefreshFields && refresh_fields) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

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

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

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

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

0 comments on commit f82d2bd

Please sign in to comment.