13 lines
221 B
Go
Raw Normal View History

2023-09-19 20:08:55 +02:00
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()))
}