`UserProfileFunctions.cs`: Deserialization errors return generic 400 with no structured logging
- Linguagem predominante
- TypeScript
- Estrelas
- 0
- Forks
- 0
- Merge médio
- 16min
- PRs com merge (30d)
- 1
Descrição
### 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`
```csharp
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:
```csharp
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.
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.