Cannot Read Property 'code' of Undefined Twitter Fix
Below is the output when running app.js. This started occurring totally at random when everything was working fine. Absolutely no changes were fabricated.
TypeError: Cannot read belongings 'message' of undefined at /dwelling/ec2-user/environment/rt-bot/app.js:78:48 at Request._callback (/home/ec2-user/environment/node_modules/twitter/lib/twitter.js:220:14) at Request.self.callback (/home/ec2-user/environment/node_modules/request/request.js:186:22) at emitTwo (events.js:106:13) at Request.emit (events.js:191:7) at Request.<anonymous> (/home/ec2-user/environment/node_modules/request/request.js:1163:ten) at emitOne (events.js:96:xiii) at Asking.emit (events.js:188:seven) at IncomingMessage.<bearding> (/home/ec2-user/environment/node_modules/request/request.js:1085:12) at IncomingMessage.g (events.js:292:sixteen) I've tried creating new instances from my primary branch (with no commits since terminal working) and even still getting this mistake. Any ideas?
The lawmaking causing the fault, though this code was working previously.
T.get('search/tweets', query, function(err, information, response) { // continue if no errors if(!err){ // loop for(permit i = 0; i < data.statuses.length; i++){ // get latest tweet ID let id = { id: information.statuses[i].id_str } // effort favorite T.postal service('favorites/create', id, role(err, response){ // log failures if(err){ panel.log('Try Favorite - ', err[0].message); } // log success else{ let username = response.user.screen_name; permit tweetId = response.id_str; panel.log('Favorited: ', `https://twitter.com/${username}/status/${tweetId}`) } }); Prototype of first occurrence. As you lot tin come across everything was functioning fine, then this error came out of nowhere with absolutely no changes to environment or codebase.
UPDATE:
Output when logging error with console.log('Try Favorite - ', err.bulletin); rather than console.log('Endeavour Favorite - ', err[0].bulletin);
[[Apr 28 21:27:00.702]] [LOG] Try Favorite - HTTP Fault: 429 Too Many Requests [[Apr 28 21:27:00.705]] [LOG] Effort Favorite - HTTP Error: 429 Too Many Requests [[April 28 21:27:00.706]] [LOG] Effort Favorite - HTTP Error: 429 As well Many Requests [[Apr 28 21:27:00.707]] [LOG] Endeavor Favorite - HTTP Error: 429 Also Many Requests [[Apr 28 21:27:00.708]] [LOG] Try Favorite - HTTP Fault: 429 Too Many Requests [[Apr 28 21:27:00.709]] [LOG] Try Favorite - HTTP Error: 429 Too Many Requests [[Apr 28 21:27:00.712]] [LOG] Try Favorite - HTTP Error: 429 Too Many Requests [[Apr 28 21:27:00.713]] [LOG] Try Favorite - HTTP Fault: 429 Too Many Requests [[April 28 21:27:00.718]] [LOG] Try Favorite - HTTP Error: 429 Too Many Requests [[April 28 21:27:00.793]] [LOG] Endeavor Favorite - HTTP Fault: 429 Also Many Requests Also notation that the retweet function uses the same console logging method. Come across lawmaking beneath, and outputs fine.
// try retweet T.mail('statuses/retweet', id, function(err, response){ // log failures if(err){ console.log('Effort Retweet - ', err[0].message); } ybarrayoushered39.blogspot.com
Source: https://stackoverflow.com/questions/50081097/typeerror-cannot-read-property-message-of-undefined-twitter-api
0 Response to "Cannot Read Property 'code' of Undefined Twitter Fix"
Post a Comment