stream: better error message for unmatched protocol

See #1187.