Skip to content

Commit 484691b

Browse files
committed
check err
1 parent 0dbb246 commit 484691b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

services/context/base.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ func (b *Base) JSON(status int, content any) {
141141
func (b *Base) HTMLString(status int, html string) {
142142
b.Resp.Header().Set("Content-Type", "text/html;charset=utf-8")
143143
b.Resp.WriteHeader(status)
144-
b.Resp.Write([]byte(html))
144+
if _, err := b.Resp.Write([]byte(html)); err != nil {
145+
log.Error("Render HTMLString failed: %v", err)
146+
}
145147
}
146148

147149
// RemoteAddr returns the client machine ip address

0 commit comments

Comments
 (0)