better error handling for QueryEvents [#75055428]