You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
385 B

package errors
import (
"fmt"
"net/http"
)
func InternalServerError(w http.ResponseWriter, r *http.Request, err error) {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(err.Error()))
}
func BadRequestError(w http.ResponseWriter, r *http.Request, err error) {
fmt.Println(err)
w.WriteHeader(http.StatusBadRequest)
w.Write([]byte(err.Error()))
}