stellar / xdrgen

A code generator for XDR
Apache License 2.0
22 stars 47 forks source link

Rust: Improve error messages when decoding #200

Open leighmcculloch opened 3 months ago

leighmcculloch commented 3 months ago

@2opremio pointed out here that the Rust generated codes error messages when decoding types is not particularly informative, especially in comparison to the Go decoder that xdrgen generates.

We should see how we can improve the Rust decoder so it is more informative and learns from investments in error messages we made in the Go decoder.

leighmcculloch commented 3 months ago

For example, when the decoder (via the CLI) sees a trailing byte that is unexpected, it returns this error:

error decoding XDR: Invalid byte 10, offset 220.