only-cliches / NoProto

Flexible, Fast & Compact Serialization with RPC
MIT License
374 stars 14 forks source link

Handling incorrect bytes rpc spec #16

Closed janjaapbos closed 2 years ago

janjaapbos commented 2 years ago

When calling NP_RPC_Factory::new_bytes() with an empty byte slice, it causes a thread panic.

I am new to Rust, so excuse my question: I would have expected the function to fail with an NP_Error.

I am loading the rpc spec in bytes from a remote endpoint, so I wanted to check for validity.

janjaapbos commented 2 years ago

Learned how to handle this error in Rust.