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

Return 400 errors on deserialization failure

Offen
#99 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement good first issue hacktoberfest help wanted
Vorherrschende Sprache
Python
Sterne
37
Forks
29
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.