Address issues from code review.

This commit is contained in:
Jussi Hallila
2021-01-18 14:36:09 +01:00
parent 62fa5496c1
commit 70255c7fff
@@ -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}`,
);
});
};