Open h-nasu opened 6 years ago
Gets below error every time doing Line webhook call because processMessage in linebot.js do not return Promise and doing error handling inside....
[ERROR] Error while message processing TypeError: Cannot read property 'catch' of undefined
apiaiRequest.on('response', (response) => { this.processAiResponse(chatId, response, message.replyToken) .then(() => this.log('Message sent')) .catch((err) => this.logError(err)) });
Fix Just check if return value is valid. app.js
var result = bot.processMessage(item, res); if (result) { result.catch(err => console.error(err)); }
or just delete '.catch(err => console.error(err));'
Gets below error every time doing Line webhook call because processMessage in linebot.js do not return Promise and doing error handling inside....
Fix Just check if return value is valid. app.js
or just delete '.catch(err => console.error(err));'