ENH: better error message when discretization might create an ambiguity. close #1978