Election-Tech-Initiative / Election-Tech-Initiative/electionguard-api-python
Return 400 errors on deserialization failure
Ouverte
enhancement
good first issue
hacktoberfest
help wanted
- Langage dominant
- Python
- Étoiles
- 37
- Forks
- 29
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
## 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.
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.