improve error reporting for invalid protocols

this greatly reduces confusion and simplifies tracing if there's a (usually silly, but non-obvious) error deep down the stack