Reduce error message redundancy in the protocol
The protocol.cpp
file is full of redundant error messages, stating that the received message is invalid.
Such error messages should be kept, but a cleaner code would not repeat the prefix at each line...
One way to improve this is to:
- Use asserts that throws an exception on error. Only use the meaningful message there without prefix.
- Surround protocol functions calls with try/catch. Rethrow errors with the desired prefix.