improve error message in a common case

I have found this to be a common error mode that produces a hard to understand error if left alone.

This doesn't change the behavior, there is a panic in any case immediately after this.