Election-Tech-Initiative / Election-Tech-Initiative/electionguard-api-python

Return 400 errors on deserialization failure

Aberta
#99 4 comentários 0 reações 0 responsáveis Ver no GitHub
enhancement good first issue hacktoberfest help wanted
Linguagem predominante
Python
Estrelas
37
Forks
29
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

## Feature Request

Until we have full Pydantic-compliant models (#98), we rely on custom deserialization in the routes, e.g.:

```python
ballots = [PlaintextBallot.from_json_object(ballot) for ballot in request.ballots]
```

If this deserialization fails, however, it manifests as an opaque `500` error to the client. We should capture deserialization errors and send a `400` with as much information as possible.

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.