s3manager-web/errors.go

17 lines
288 B
Go
Raw Normal View History

2017-03-30 14:00:06 +02:00
package main
import (
"log"
"net/http"
)
// handleHTTPError handles HTTP errors
func handleHTTPError(w http.ResponseWriter, msg string, err error, statusCode int) {
http.Error(w, msg, statusCode)
if err != nil {
log.Println(msg+":", err.Error())
} else {
log.Println(msg)
}
}