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

Return 400 errors on deserialization failure

Đang mở
#99 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement good first issue hacktoberfest help wanted
Ngôn ngữ chính
Python
Star
37
Fork
29
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.