mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 14:37:36 +02:00
Improve package API log handling (#35100)
Simplify code and fix log processing logic
This commit is contained in:
1 parent
37958e486a
commit
f0da1de7e3
23 files changed
+101
-132
No files matched your search
@@ -43,13 +43,12 @@ func apiError(ctx *context.Context, status int, obj any) {
|
||||
Error Error `json:"error"`
|
||||
}
|
||||
|
||||
helper.LogAndProcessError(ctx, status, obj, func(message string) {
|
||||
jsonResponse(ctx, status, ErrorWrapper{
|
||||
Error: Error{
|
||||
Code: http.StatusText(status),
|
||||
Message: message,
|
||||
},
|
||||
})
|
||||
message := helper.ProcessErrorForUser(ctx, status, obj)
|
||||
jsonResponse(ctx, status, ErrorWrapper{
|
||||
Error: Error{
|
||||
Code: http.StatusText(status),
|
||||
Message: message,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user