Skip to content
This repository was archived by the owner on Feb 22, 2020. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions src/lang-go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,23 +326,34 @@ async function repositoriesThatImportViaGDDO(
)
.slice(0, limit)
.map(async repo => {
const gqlResponse = await queryGraphQL(
`
try {
const gqlResponse = await queryGraphQL(
`
query($cloneURL: String!) {
repository(cloneURL: $cloneURL) {
name
}
}
`,
{ cloneURL: repo }
)
if (!gqlResponse || !gqlResponse.repository || !gqlResponse.repository.name) {
// We only know how to construct zip URLs for fetching repos
// on Sourcegraph instances. Since this candidate repo is absent from
// the Sourcegraph instance, discard it.
{ cloneURL: repo }
)
if (!gqlResponse || !gqlResponse.repository || !gqlResponse.repository.name) {
// We only know how to construct zip URLs for fetching repos
// on Sourcegraph instances. Since this candidate repo is absent from
// the Sourcegraph instance, discard it.
return undefined
}
return gqlResponse.repository.name as string
} catch (err) {
if (err.message && err.message.includes('ExternalRepo:<nil>')) {
console.warn(
`Unable to find cross-repository references in ${repo}, probably because the repository was renamed and Sourcegraph does not support renamed repositories yet.`
)
} else {
console.warn(err)
}
return undefined
}
return gqlResponse.repository.name as string
})
)).filter((repo): repo is string => !!repo)
return new Set(
Expand Down