Skip to content

Commit 3f2d8b0

Browse files
committed
dont drop err
1 parent 900ceb2 commit 3f2d8b0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

routers/api/v1/activitypub/person.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"code.gitea.io/gitea/modules/activitypub"
1212
"code.gitea.io/gitea/modules/context"
1313
"code.gitea.io/gitea/modules/json"
14+
"code.gitea.io/gitea/modules/log"
1415
"code.gitea.io/gitea/modules/setting"
1516
"code.gitea.io/gitea/routers/api/v1/user"
1617

@@ -95,8 +96,13 @@ func Person(ctx *context.APIContext) {
9596

9697
ctx.Resp.Header().Add("Content-Type", "application/activity+json")
9798
ctx.Resp.WriteHeader(http.StatusOK)
98-
binary, _ = json.Marshal(jsonmap)
99-
ctx.Resp.Write(binary)
99+
binary, err = json.Marshal(jsonmap)
100+
if err != nil {
101+
ctx.Error(http.StatusInternalServerError, "Marshal", err)
102+
}
103+
if _, err = ctx.Resp.Write(binary); err != nil {
104+
log.Error("write to resp err: %v", err)
105+
}
100106
}
101107

102108
// PersonInbox function

0 commit comments

Comments
 (0)