fix: log internal errors server-side, add timeout to GDPR goroutine
This commit is contained in:
@@ -2,6 +2,7 @@ package scheduling
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"strconv"
|
||||
@@ -131,7 +132,8 @@ func CreateExceptionalGroup(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
if err := validators.Validate.Struct(&g); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
log.Printf("Failed to process request: %v", err)
|
||||
http.Error(w, "Invalid request", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -302,7 +304,8 @@ func UpdateExceptionalApplications(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
if err := validators.Validate.Struct(&req); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
log.Printf("Failed to process request: %v", err)
|
||||
http.Error(w, "Invalid request", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user