Skip to content
Snippets Groups Projects
Unverified Commit a202a09e authored by Pierre-Yves Bigourdan's avatar Pierre-Yves Bigourdan Committed by GitHub
Browse files

Fix [Gitea] not found message (#10373)

parent 62ed7c3a
No related branches found
No related tags found
No related merge requests found
......@@ -5,10 +5,10 @@ By default this badge looks for repositories on [gitea.com](https://gitea.com).
To specify another instance like [codeberg](https://codeberg.org/), [forgejo](https://forgejo.org/) or a self-hosted instance, use the \`gitea_url\` query param.
`
function httpErrorsFor() {
function httpErrorsFor(notFoundMessage = 'user or repo not found') {
return {
403: 'private repo',
404: 'user, repo or path not found',
404: notFoundMessage,
}
}
......
......@@ -61,7 +61,7 @@ export default class GiteaLanguageCount extends GiteaBase {
return super.fetch({
schema,
url: `${baseUrl}/api/v1/repos/${user}/${repo}/languages`,
httpErrors: httpErrorsFor('user or repo not found'),
httpErrors: httpErrorsFor(),
})
}
......
......@@ -127,7 +127,7 @@ export default class GiteaLastCommit extends GiteaBase {
schema,
url: `${baseUrl}/api/v1/repos/${user}/${repo}/commits`,
options: { searchParams: { sha: branch, path, limit: 1 } },
httpErrors: httpErrorsFor(),
httpErrors: httpErrorsFor('user, repo or path not found'),
})
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment