Add more informative exception for select queries