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:
|
throw DeserializationError(object, specifiedType, error); |
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
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
DeserializationErrorand if you catch that in your code there's a linter that rise:The error is thrown here:
built_value.dart/built_value/lib/src/built_json_serializers.dart
Line 180 in 8b3dd1b
Proposal
Return an
Exceptioninstead 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