Fixing getProjectId error message to be more descriptive
Signed-off-by: Joshua Jung <joshua.p.jung@gmail.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'@backstage/backend-defaults': patch
|
||||
'@backstage/integration': patch
|
||||
---
|
||||
|
||||
Updating error message for getProjectId when fetching Gitlab project from its url to be more accurate
|
||||
@@ -697,7 +697,9 @@ describe('GitlabUrlReader', () => {
|
||||
(gitlabProcessor as any).getGitlabFetchUrl(
|
||||
'https://gitlab.com/some/random/endpoint',
|
||||
),
|
||||
).rejects.toThrow('Please provide full path to yaml file from GitLab');
|
||||
).rejects.toThrow(
|
||||
'Failed converting /some/random/endpoint to a project id. Url path must include /blob/.',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -116,7 +116,9 @@ export async function getProjectId(
|
||||
const url = new URL(target);
|
||||
|
||||
if (!url.pathname.includes('/blob/')) {
|
||||
throw new Error('Please provide full path to yaml file from GitLab');
|
||||
throw new Error(
|
||||
`Failed converting ${url.pathname} to a project id. Url path must include /blob/.`,
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user