error handling
See original GitHub issueHi, i dont know how to handling error that say in this link line messaging api ref, it said
The following JSON data is returned in the response body when an error occurs.
so, i try using this
return client.replyMessage(event.replyToken, { type: "text", text: "" //im leaving this empty for testing });
i try to get this response (like in api reference)
{ "message":"The request body has 2 error(s)", "details":[ { "message":"May not be empty", "property":"messages[0].text" }, { "message":"Must be one of the following values: [text, image, video, audio, location, sticker, template, imagemap]", "property":"messages[1].type" } ] }
but i dont know how
this is my full script server.js
TIA
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
i see, thanks for fast reply!
And by the way, the type of this kind of Error should be
HTTPError
. You can also handle it aserror instanceof HTTPError