mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-01 17:38:33 +00:00
Handle invalid target when creating releases using API (#31841)
A 500 status code was thrown when passing a non-existent target to the create release API. This snapshot handles this error and instead throws a 404 status code. Discovered while working on #31840. (cherry picked from commit f05d9c98c4cb95e3a8a71bf3e2f8f4529e09f96f)
This commit is contained in:
parent
5c7b85a981
commit
eb765dabfd
3 changed files with 22 additions and 1 deletions
|
@ -74,7 +74,7 @@ func createTag(ctx context.Context, gitRepo *git.Repository, rel *repo_model.Rel
|
|||
|
||||
commit, err := gitRepo.GetCommit(rel.Target)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("createTag::GetCommit[%v]: %w", rel.Target, err)
|
||||
return false, err
|
||||
}
|
||||
|
||||
if len(msg) > 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue