Improve query validation error message

Print file, line, query type and expression