Use exceptions instead of assertions for protocol errors.