membersheep / 4bot

A telegram bot to serve random images from 4chan image boards.
MIT License
16 stars 12 forks source link

Handle all errors #5

Closed membersheep closed 8 years ago

membersheep commented 8 years ago

Handle telegram API errors and notify them to the user.

membersheep commented 8 years ago
 /app/modules/telegramAPI.js:50
             throw error;
             ^
 Error: ENOENT: no such file or directory, unlink '/app/modules/../images/1454060662007.jpg'
     at Error (native)
membersheep commented 8 years ago
 error:  Error: Unable to download JSON. Code 404
     at Request._callback (/app/modules/4ChanAPI.js:23:23)
     at Request.self.callback (/app/node_modules/request/request.js:198:22)
     at emitTwo (events.js:87:13)
     at Request.emit (events.js:172:7)
     at Request.<anonymous> (/app/node_modules/request/request.js:1035:10)
     at emitOne (events.js:82:20)
     at Request.emit (events.js:169:7)
     at IncomingMessage.<anonymous> (/app/node_modules/request/request.js:962:12)
     at emitNone (events.js:72:20)
     at IncomingMessage.emit (events.js:166:7)