From 18dad948a10a2034959e1eb14b3c41669683e1fb Mon Sep 17 00:00:00 2001 From: Emma Indal Date: Mon, 20 Jun 2022 15:46:06 +0200 Subject: [PATCH] add custom search error Signed-off-by: Emma Indal --- plugins/search-backend-node/src/errors.ts | 23 +++++++++++++++++++++++ plugins/search-backend-node/src/index.ts | 1 + 2 files changed, 24 insertions(+) create mode 100644 plugins/search-backend-node/src/errors.ts diff --git a/plugins/search-backend-node/src/errors.ts b/plugins/search-backend-node/src/errors.ts new file mode 100644 index 0000000000..c6128f3f2e --- /dev/null +++ b/plugins/search-backend-node/src/errors.ts @@ -0,0 +1,23 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { CustomErrorBase } from '@backstage/errors'; + +/** + * Failed to query documents for index that does not exist. + * @public + */ +export class MissingIndexError extends CustomErrorBase {} diff --git a/plugins/search-backend-node/src/index.ts b/plugins/search-backend-node/src/index.ts index d342bb9259..854881829c 100644 --- a/plugins/search-backend-node/src/index.ts +++ b/plugins/search-backend-node/src/index.ts @@ -34,6 +34,7 @@ export type { RegisterCollatorParameters, RegisterDecoratorParameters, } from './types'; +export * from './errors'; export * from './indexing'; export * from './test-utils';