From f235e4064fc5358faccafb51b73d5f685a99bc8a Mon Sep 17 00:00:00 2001 From: Kiss Miklos Date: Mon, 13 Mar 2023 10:18:46 +0100 Subject: [PATCH] return undefined if there is no match Signed-off-by: Kiss Miklos --- .../catalog-backend/src/modules/codeowners/lib/resolve.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/plugins/catalog-backend/src/modules/codeowners/lib/resolve.ts b/plugins/catalog-backend/src/modules/codeowners/lib/resolve.ts index 92fa4a0ef6..675f6542aa 100644 --- a/plugins/catalog-backend/src/modules/codeowners/lib/resolve.ts +++ b/plugins/catalog-backend/src/modules/codeowners/lib/resolve.ts @@ -30,13 +30,7 @@ export function resolveCodeOwner( const { filepath } = parseGitUrl(catalogInfoFileUrl); const match = codeowners.matchFile(filepath, codeOwnerEntries); - if (!match) { - throw new Error( - `There is no matching entry for path: ${filepath} in the CODEOWNERS file`, - ); - } - - return normalizeCodeOwner(match.owners[0]); + return match ? normalizeCodeOwner(match.owners[0]) : undefined; } export function normalizeCodeOwner(owner: string) {