Skip to content

Commit

Permalink
add more logs if failed to validate
Browse files Browse the repository at this point in the history
  • Loading branch information
sword-jin committed Dec 26, 2024
1 parent 172bf2a commit 48012e7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ func (s Server) resourceGetHandler(w http.ResponseWriter, r *http.Request, id st
func (s Server) resourcePatchHandler(w http.ResponseWriter, r *http.Request, id string, resourceType ResourceType) {
patch, scimErr := resourceType.validatePatch(r)
if scimErr != nil {
s.log.Error(
"failed validating resource",
"error", scimErr,
)
s.errorHandler(w, scimErr)
return
}
Expand Down Expand Up @@ -130,6 +134,10 @@ func (s Server) resourcePostHandler(w http.ResponseWriter, r *http.Request, reso

attributes, scimErr := resourceType.validate(data)
if scimErr != nil {
s.log.Error(
"failed validating resource",
"error", scimErr,
)
s.errorHandler(w, scimErr)
return
}
Expand Down Expand Up @@ -174,6 +182,10 @@ func (s Server) resourcePutHandler(w http.ResponseWriter, r *http.Request, id st

attributes, scimErr := resourceType.validate(data)
if scimErr != nil {
s.log.Error(
"failed validating resource",
"error", scimErr,
)
s.errorHandler(w, scimErr)
return
}
Expand Down

0 comments on commit 48012e7

Please sign in to comment.