-1

My code is:

for(int i=0;i<listTweetId.size();i++){    
     if((status = twitter.getStatus(listTweetId.get(i)))!=null){
      ...

My problem is that exist some tweetId into listTweetId that are Id of tweets deleted and I don't know how it verify, because my if not works for this case. Finally in this case it spears a error, that is follows :

Exception in thread "main" winterwell.jtwitter.TwitterException$E404: 
    Not Found HTTP/1.1 404 Not Found 
    {"error":"No status found with that ID.","request":"/1/statuses/show/112779914381492224.json?include_entities=1&"} 

P.S.: Tweets are not empty

Jean-Charles
  • 1,690
  • 17
  • 28
matias
  • 59
  • 4

1 Answers1

2

I'm not entirely sure what your question is, but if the issue is that getting the status for a non-existent tweet throws an exception, you need to wrap that part in a try/catch to avoid dropping out of the loop.

Dave Newton
  • 158,873
  • 26
  • 254
  • 302