mirror of
https://github.com/foomo/keel.git
synced 2025-10-16 12:35:34 +00:00
18 lines
455 B
Go
18 lines
455 B
Go
package httputils
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"go.uber.org/zap"
|
|
|
|
"github.com/foomo/keel/log"
|
|
)
|
|
|
|
// InternalServerError http response
|
|
func InternalServerError(l *zap.Logger, w http.ResponseWriter, r *http.Request, err error) {
|
|
if err != nil {
|
|
log.Configure(l).HTTPRequest(r).Error(err).Logger().Error("http internal server error")
|
|
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) // TODO enrich headers
|
|
}
|
|
}
|