Consolidate error handling.

This commit is contained in:
2024-07-24 23:49:15 +01:00
parent 88c566ee9a
commit 1725579d82
2 changed files with 141 additions and 140 deletions
+2 -1
View File
@@ -75,6 +75,7 @@ type Logger interface {
Errorf(format string, args ...interface{})
}
func handleError(w http.ResponseWriter, message string, code int) {
func handleError(w http.ResponseWriter, message string, code int, logger Logger) {
logger.Errorf(message)
http.Error(w, message, code)
}