update readFile to pass a line number when an error occurs