catch query errors and package in results object