recv_pattern(): Improve error diagnostics.