Raise a better exception if the query string is empty