Skip to content

Handle Errors caused by using wrong command. #27

@yashmehrotra

Description

@yashmehrotra

For eg. @osdc-bot karma is the wrong command.

Below is the traceback. This causes the app to exit.

[INFO] In loop karma
/home/osdc-bot/chatbot.js:57
    } else if (msgBody[2].trim() === "++") {
                         ^

TypeError: Cannot read property 'trim' of undefined
    at getBotReply (/home/osdc-bot/chatbot.js:57:26)
    at Request._callback (/home/osdc-bot/api.js:32:9)
    at Request.self.callback (/home/osdc-bot/node_modules/request/request.js:187:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (/home/osdc-bot/node_modules/request/request.js:1044:10)
    at emitOne (events.js:77:13)
    at Request.emit (events.js:169:7)
    at IncomingMessage.<anonymous> (/home/osdc-bot/node_modules/request/request.js:965:12)
    at emitNone (events.js:72:2

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions