Skip to content

Commit 2a42d67

Browse files
quentinbtHyunje Jun
authored andcommitted
add a catch to promise for echo-bot (#52)
1 parent d1fe4f2 commit 2a42d67

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/echo-bot/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ app.post('/callback', line.middleware(config), (req, res) => {
2222
Promise
2323
.all(req.body.events.map(handleEvent))
2424
.then((result) => res.json(result));
25+
.catch((err) => {
26+
console.error(err);
27+
res.status(500).end();
28+
});
2529
});
2630

2731
// event handler

0 commit comments

Comments
 (0)