check err

This commit is contained in:
silverwind 2024-04-25 23:39:31 +02:00
parent 0dbb24635a
commit 484691be05
No known key found for this signature in database
GPG Key ID: 2E62B41C93869443
1 changed files with 3 additions and 1 deletions

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