Catch errors caused by invalid query format on stats engine