Problem
When request body deserialization fails in UserProfileFunctions, the handler returns a generic BadRequest("Invalid request body.") with no log entry:
File: PluckIt.Functions/Functions/UserProfileFunctions.cs:63
catch (JsonException)
{
return new BadRequestObjectResult("Invalid request body.");
}
Operators have no way to see what payload caused the failure, which field was missing, or how often this happens.
Proposed Fix
Add structured logging before returning:
catch (JsonException ex)
{
logger.LogWarning(ex, "Profile deserialization failed for request to {Path}", req.Path);
return new BadRequestObjectResult("Invalid request body.");
}
Functionality Impact
None. Same 400 response to callers, but now logged for operators.
Problem
When request body deserialization fails in
UserProfileFunctions, the handler returns a genericBadRequest("Invalid request body.")with no log entry:File:
PluckIt.Functions/Functions/UserProfileFunctions.cs:63Operators have no way to see what payload caused the failure, which field was missing, or how often this happens.
Proposed Fix
Add structured logging before returning:
Functionality Impact
None. Same 400 response to callers, but now logged for operators.