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

Return 400 errors on deserialization failure

Abierto
#99 4 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement good first issue hacktoberfest help wanted
Lenguaje dominante
Python
Estrellas
37
Forks
29
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

## 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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.