Improve package API log handling (#35100)

Simplify code and fix log processing logic
This commit is contained in:
wxiaoguang authored and GitHub committed 2025-07-16 12:25:49 -04:00
1 parent 37958e486a
commit f0da1de7e3
23 files changed
+101 -132

No files matched your search

+3 -4
View File
@@ -61,10 +61,9 @@ func jsonResponse(ctx *context.Context, status int, obj any) {
}
func apiError(ctx *context.Context, status int, obj any) {
helper.LogAndProcessError(ctx, status, obj, func(message string) {
jsonResponse(ctx, status, map[string]string{
"message": message,
})
message := helper.ProcessErrorForUser(ctx, status, obj)
jsonResponse(ctx, status, map[string]string{
"message": message,
})
}