From 70255c7fff4ec2e9b0654de52644d298a43017b2 Mon Sep 17 00:00:00 2001 From: Jussi Hallila Date: Mon, 18 Jan 2021 14:36:09 +0100 Subject: [PATCH] Address issues from code review. --- plugins/catalog-import/src/util/useGithubRepos.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/catalog-import/src/util/useGithubRepos.ts b/plugins/catalog-import/src/util/useGithubRepos.ts index 704ad974a5..db3ee9aa09 100644 --- a/plugins/catalog-import/src/util/useGithubRepos.ts +++ b/plugins/catalog-import/src/util/useGithubRepos.ts @@ -70,7 +70,7 @@ export function useGithubRepos() { githubIntegrationConfig, }) .catch(e => { - throw new Error(`Failed to submit PR to repo:\n${e.message}`); + throw new Error(`Failed to submit PR to repo: ${e.message}`); }); await api @@ -78,7 +78,7 @@ export function useGithubRepos() { location: submitPRResponse.location, }) .catch(e => { - throw new Error(`Failed to create repository location:\n${e.message}`); + throw new Error(`Failed to create repository location: ${e.message}`); }); return submitPRResponse; @@ -95,7 +95,7 @@ export function useGithubRepos() { try { githubConfig = getGithubIntegrationConfig(location); } catch (e) { - return Promise.resolve({ exists: false }); + return { exists: false }; } return await api .checkForExistingCatalogInfo({ @@ -105,7 +105,7 @@ export function useGithubRepos() { }) .catch(e => { throw new Error( - `Failed to inspect repository for existing catalog-info.yaml:\n${e.message}`, + `Failed to inspect repository for existing catalog-info.yaml: ${e.message}`, ); }); };