Keep getting status error 401



I have developed a twitter application that get the 100 tweets of a user and i am making 100 GET request per 15 min window as per twitter guidelines ( but i am still getting an error 401. I am posting the error output below.

Traceback (most recent call last):
  File "", line 185, in <module>
    test = api.user_timeline(int(p['id_str']),count=100)
  File "/usr/local/lib/python3.4/dist-packages/tweepy/", line 243, in _call
    return method.execute()
  File "/usr/local/lib/python3.4/dist-packages/tweepy/", line 227, in execute
    raise TweepError(error_msg, resp)
tweepy.error.TweepError: Twitter error response: status code = 401


Error was when twitter was returning data (thats is the requested 100 tweets) it was returning a blank tweet (user must have deleted that tweet) which was the cause of error. Make sure u guys catch such cases.