More error logging when query execution is called inappropiately.
Let's throw an exception when called inappropiately.