18 lines
354 B
Go
18 lines
354 B
Go
package server
|
|
|
|
import "net/http"
|
|
|
|
type httpError struct {
|
|
code int
|
|
error
|
|
}
|
|
|
|
func internalError(err error) *httpError {
|
|
return &httpError{http.StatusInternalServerError, err}
|
|
}
|
|
func badRequest(err error) *httpError {
|
|
return &httpError{http.StatusBadRequest, err}
|
|
}
|
|
func notFound(err error) *httpError {
|
|
return &httpError{http.StatusNotFound, err}
|
|
}
|