AB-Law / AB-Law/Pluck-It

`UserProfileFunctions.cs`: Deserialization errors return generic 400 with no structured logging

Aberta
#64 0 comentários 0 reações 0 responsáveis Ver no GitHub
enhancement good first issue
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

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.