Skip to content

BuiltJsonSerializers throws an Error on deserialization exception but it should? #1293

@danielgomezrico

Description

@danielgomezrico

My current use case is that I'm using chopper to send HTTP requests and made it to use serialization with built_value, so all requests are serialized/deserialized with this.

On Every HTTP request, I catch errors to avoid unhandled cases. I found out that there may be cases where I defined a backend response in a way but for some reason it started sending another json or missed some params.

I want to monitor these cases and for that, I need to handle this case in my app.

Current

In the current implementation of the json serializers, it throws a DeserializationError and if you catch that in your code there's a linter that rise:

The error is thrown here:

Proposal

Return an Exception instead of an Error because this is something that you as a developer must handle, right? In your workflow, this kind of error may occur and having an error

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions