Browse Source

check err

pull/30707/head
silverwind 1 week ago
parent
commit
484691be05
No account linked to committer's email address
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      services/context/base.go

+ 3
- 1
services/context/base.go View File

@@ -141,7 +141,9 @@ func (b *Base) JSON(status int, content any) {
func (b *Base) HTMLString(status int, html string) {
b.Resp.Header().Set("Content-Type", "text/html;charset=utf-8")
b.Resp.WriteHeader(status)
b.Resp.Write([]byte(html))
if _, err := b.Resp.Write([]byte(html)); err != nil {
log.Error("Render HTMLString failed: %v", err)
}
}

// RemoteAddr returns the client machine ip address

Loading…
Cancel
Save