Return git errors gracefully instead of rendering them as 500 Server Error #4124

Open
opened 2025-11-02 05:39:08 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @guillep2k on GitHub (Oct 16, 2019).

Many errors, especially those from git, are rendered as 500 Server Error pages. It seems to me that in many situations the end users could work out the problem if they were aware of the actual error, which is completely hidden from them in production mode.

The end user may or may not have rapid access to the Gitea administrator to help them with this problem, and they certainly don't have access to a quick new Gitea version that fixes it, if it's Gitea's to fix at all. They may also be pressed to finish some work and they may be blocked by their problem.

So I think that it would be great if Gitea used functions like ctx.RenderWithErr() to give the user a tidy feedback instead of a crash page. Something similar could be said about the git server.

Security should be considered, though, as error messages might expose data unintendedly.

Originally created by @guillep2k on GitHub (Oct 16, 2019). Many errors, especially those from git, are rendered as `500 Server Error` pages. It seems to me that in many situations the end users could work out the problem if they were aware of the actual error, which is completely hidden from them in production mode. The end user may or may not have rapid access to the Gitea administrator to help them with this problem, and they certainly don't have access to a quick new Gitea version that fixes it, if it's Gitea's to fix at all. They may also be pressed to finish some work and they may be blocked by their problem. So I think that it would be great if Gitea used functions like `ctx.RenderWithErr()` to give the user a tidy feedback instead of a crash page. Something similar could be said about the git server. Security should be considered, though, as error messages might expose data unintendedly.
GiteaMirror added the type/proposal label 2025-11-02 05:39:08 -06:00
Author
Owner

@zeripath commented on GitHub (Oct 16, 2019):

Agreed. We jump straight to 500 far too often when we could recover.

In terms of the merge issues I'm looking at detecting merge fails a bit better and being able to report these a little nicer.

@zeripath commented on GitHub (Oct 16, 2019): Agreed. We jump straight to 500 far too often when we could recover. In terms of the merge issues I'm looking at detecting merge fails a bit better and being able to report these a little nicer.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4124