minetest-web/send.go
BuckarooBanzay 72ecc247d1 ws
2023-09-19 20:08:55 +02:00

13 lines
221 B
Go

package main
import (
"fmt"
"net/http"
)
func SendError(w http.ResponseWriter, status int, err error) {
fmt.Printf("HTTP Error %d: '%s'\n", status, err.Error())
w.WriteHeader(status)
w.Write([]byte(err.Error()))
}