dont drop err

This commit is contained in:
6543 2022-06-14 14:26:41 +02:00
parent 900ceb2dfd
commit 3f2d8b015f
No known key found for this signature in database
GPG Key ID: C99B82E40B027BAE
1 changed files with 8 additions and 2 deletions

View File

@ -11,6 +11,7 @@ import (
"code.gitea.io/gitea/modules/activitypub"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/json"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/routers/api/v1/user"
@ -95,8 +96,13 @@ func Person(ctx *context.APIContext) {
ctx.Resp.Header().Add("Content-Type", "application/activity+json")
ctx.Resp.WriteHeader(http.StatusOK)
binary, _ = json.Marshal(jsonmap)
ctx.Resp.Write(binary)
binary, err = json.Marshal(jsonmap)
if err != nil {
ctx.Error(http.StatusInternalServerError, "Marshal", err)
}
if _, err = ctx.Resp.Write(binary); err != nil {
log.Error("write to resp err: %v", err)
}
}
// PersonInbox function