Skip to content

Commit

Permalink
Fix [Gitea] not found message (badges#10373)
Browse files Browse the repository at this point in the history
  • Loading branch information
PyvesB authored Jul 22, 2024
1 parent 62ed7c3 commit a202a09
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions services/gitea/gitea-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
2 changes: 1 addition & 1 deletion services/gitea/gitea-languages-count.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
})
}

Expand Down
2 changes: 1 addition & 1 deletion services/gitea/gitea-last-commit.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
})
}

Expand Down

0 comments on commit a202a09

Please sign in to comment.