Skip to content

Conversation

@luisguilhermemsalmeida
Copy link

Encoding integer values of out the specified range (overflow) results in an invalid binary which crashes the decoding in a way that is very hard to troubleshoot. It's best if the encoding fails with an easy message:

** (ErlangError) Erlang error: {:gpb_type_error, {{:value_out_of_range, :unsigned, 32}, [value: 340282366920938463463374607431768211456, path: 'path_to_the_invalid_field']}}

https://github.com/tomas-abrahamsson/gpb README file states:

Gpb can optionally generate code for verification of values during encoding this makes it easy to catch e.g integers out of range, or values of the wrong type.

@luisguilhermemsalmeida
Copy link
Author

@bitwalker Did you have the time to take a look at this PR? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant