401:Authentication credentials error after running the app for a while!?

oauth
api

#1

I’m getting the below error when I’m running my code for a while. I have to stop my code and rerun it again to overcome the issue. Why is this happening?

401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the system clock is in sync.
{“request”:"/1.1/statuses/user_timeline.json",“error”:“Not authorized.”}