summaryrefslogtreecommitdiffstats
path: root/services/release
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2024-09-17 10:23:40 +0800
committerGitHub <noreply@github.com>2024-09-17 02:23:40 +0000
commite6395e1e81dd292417b04ce1fe3b51e50d978ca4 (patch)
tree2c0b5e576ee69b9a327bec4863a5a73f44ccf233 /services/release
parent8a39a4812f1423a92d9834b6271f7b731dffe996 (diff)
downloadgitea-e6395e1e81dd292417b04ce1fe3b51e50d978ca4.tar.gz
gitea-e6395e1e81dd292417b04ce1fe3b51e50d978ca4.zip
Handle invalid target when creating releases using API (#31841) (#32043)
Backport #31841 by @kemzeb 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. Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
Diffstat (limited to 'services/release')
-rw-r--r--services/release/release.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/release/release.go b/services/release/release.go
index 399fdc79c0..5c021404b8 100644
--- a/services/release/release.go
+++ b/services/release/release.go
@@ -65,7 +65,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 {