improve error messages for unparseable queries