More helpful error message when trying to import by folder from non-github
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -44,8 +44,12 @@ export function basicIntegrations<T extends ScmIntegration>(
|
||||
return integrations;
|
||||
},
|
||||
byUrl(url: string | URL): T | undefined {
|
||||
const parsed = typeof url === 'string' ? new URL(url) : url;
|
||||
return integrations.find(i => getHost(i) === parsed.hostname);
|
||||
try {
|
||||
const parsed = typeof url === 'string' ? new URL(url) : url;
|
||||
return integrations.find(i => getHost(i) === parsed.hostname);
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
byHost(host: string): T | undefined {
|
||||
return integrations.find(i => getHost(i) === host);
|
||||
|
||||
Reference in New Issue
Block a user