From e26808e2f3ff9a2bbd0a9867c37c7c6d0b0ddea3 Mon Sep 17 00:00:00 2001 From: qowevisa Date: Sat, 16 Nov 2024 11:42:59 +0200 Subject: [PATCH] Add loging ShouldBindJSON error to console --- handlers/user_scope_CRUD.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/handlers/user_scope_CRUD.go b/handlers/user_scope_CRUD.go index 66babd4..d903a47 100644 --- a/handlers/user_scope_CRUD.go +++ b/handlers/user_scope_CRUD.go @@ -115,7 +115,8 @@ func UpdateHandler[T db.UserIdentifiable, R any]( var updates R if err := c.ShouldBindJSON(&updates); err != nil { - c.JSON(400, types.ErrorResponse{Message: "Invalid request"}) + log.Printf("c.ShouldBindJSON: error: %v\n", err) + c.JSON(400, types.ErrorResponse{Message: "Invalid request: 2"}) return }