For a contourless plot, matplotlib.pyplot.contour correctly throws the error
matplotlib.pyplot.contour
UserWarning: No contour levels were found within the data range.