mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-07-19 01:29:40 +02:00
fix(packages): skip another stack frame from logging (#8530)
Log the right stack frame line. We currently always show the `apiError` method call. related to #8529 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8530 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Michael Kriese <michael.kriese@visualon.de> Co-committed-by: Michael Kriese <michael.kriese@visualon.de>
This commit is contained in:
parent
ec8c0a50c2
commit
09c9108a35
1 changed files with 2 additions and 1 deletions
|
@ -25,7 +25,8 @@ func LogAndProcessError(ctx *context.Context, status int, obj any, cb func(strin
|
|||
message = fmt.Sprintf("%s", obj)
|
||||
}
|
||||
if status == http.StatusInternalServerError {
|
||||
log.ErrorWithSkip(1, message)
|
||||
// LogAndProcessError is always wrapped in a `apiError` call, so we need to skip two frames
|
||||
log.ErrorWithSkip(2, message)
|
||||
|
||||
if setting.IsProd && (ctx.Doer == nil || !ctx.Doer.IsAdmin) {
|
||||
message = ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue