Agent finding and reasoning about errors