question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi, 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
EriecTanijayacommented, Dec 10, 2019

i see, thanks for fast reply!

0reactions
xingoxucommented, Dec 10, 2019

And by the way, the type of this kind of Error should be HTTPError. You can also handle it as error instanceof HTTPError

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Exception Handling? - SearchSoftwareQuality
Exception handling is the process of responding to unwanted or unexpected events when a computer program runs. Exception handling deals with these events...
Read more >
Exception handling - Wikipedia
In computing and computer programming, exception handling is the process of responding to the occurrence of exceptions – anomalous or exceptional conditions ...
Read more >
Error Handling — The Swift Programming Language (Swift 5.7)
Error handling is the process of responding to and recovering from error conditions in your program. Swift provides first-class support for throwing, ...
Read more >
Control flow and error handling - JavaScript - MDN Web Docs
Exception handling statements. You can throw exceptions using the throw statement and handle them using the try...catch statements.
Read more >
Error handling - Express.js
Error Handling refers to how Express catches and processes errors that occur both synchronously and asynchronously. Express comes with a default error ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found