rogueserver/api/error.go

12 lines
199 B
Go
Raw Normal View History

2024-04-07 14:22:34 -07:00
package api
import (
"log"
"net/http"
)
2024-04-08 17:44:36 -07:00
func httpError(w http.ResponseWriter, r *http.Request, err error, code int) {
log.Printf("%s: %s\n", r.URL.Path, err)
http.Error(w, err.Error(), code)
2024-04-07 14:22:34 -07:00
}