log query errors