title: How can I determine if try returned an error or not?
body: <p>I am trying to do the following:</p>
  
  <p><code>try(htmlParse(ip[1], T)</code>, </p>
  
  <p>where I define a as:</p>
  
  <pre><code>ip[1] = paste('http://en.wikipedia.org/wiki/George_Clooney')
  </code></pre>
  
  <p>I want to check if the htmlParse worked or not. For many names in my list, there will be no wikipedia sites and thus I need to be able to check and replace ip[1] with NA if the wiki pages does not exist.</p>
  
  <p>Can someone please advise how I can do that. I tried using the command geterrmessage(), however I am not sure how to flush that everytime I change the name of the celebrity.</p>
  
  <p>Currently I have the following:</p>
  
  <pre><code>if(!isTRUE(as.logical(grep(ip[1],err)))) {
      ip[1] = NA
      }
      else {
  </code></pre>
  
  <p>This is definately incorrect as it is not running the logical statement I want.</p>
  
  <p>Thanks</p>
  
  <p>Amar</p>