Conversation
The Gitea SDK returns errors containing only the server's message field, which Forgejo blanks on 500s in production and which is sometimes cryptic (409 'Release has no Tag' means a release already exists). Add a wrapErr helper that includes the operation name and HTTP status, apply it across the gitea backend, and map the release-create 409 to a message that says what happened. Fixes #166
andrew
force-pushed
the
gitea-release-errors
branch
from
September 24, 2026 16:37
d6cf915 to
272b029
Compare
|
wow, didn't expect such a big PR... Hope I can get it tested over the weekend. Doesn't take to much for me to reproduce. Appreciate your quick turn around |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Gitea SDK's error handling reads only the
messagefield from the response body and discards the HTTP status. Forgejo returns two responses that make this useless:409 {"message":"Release has no Tag"}when a release already exists for the tag (the wording refers to an internalis_tagcolumn, not the git tag)500 {"message":""}for anything that reaches a catch-all branch, since Forgejo blanks 500 messages for non-admins in productionso
forge release createprintedError: Release has no Tagor a bareError:respectively, and any other endpoint that hit a 500 did the same.Add a
wrapErr(op, resp, err)helper that includes the operation name andresp.Status, and route every SDK error in the gitea backend through it. 404 still maps toforge.ErrNotFound, and theErrOwnerNotFound/ErrLabelExistsspecial cases are preserved. The release-create 409 is mapped torelease for tag "v1.0.0" already exists.Fixes #166