This error message is not obvious. The two cases should really be handled separately.