dylanmckay/protocol

remove panic on unknown discriminator

derkbell opened this issue · 1 comments

This panic line caused one of our production systems to crash when trying to decode messages on a noisy channel.

_ => panic!("unknown discriminator"), // FIXME: this should not be a panic

Now, I'm happy to fix this and submit a pull request but how? Because this is part of the derived parcel implementation, I'm not sure what the generated code ends up looking like or what can be returned here to replace the panic

Can it just return some protocol::Error instead of panic?