Make a new exception to fix error on invalid query.