query: better exception message