storing query errors in our database class