When incorrect, reply the errors too

Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
Fabio José 2019-06-25 10:54:39 -03:00
parent 3f50e71953
commit 6c5b7e2c86
1 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,10 @@ app.post('/', function (req, res) {
try {
var event = unmarshaller.unmarshall(req.body, req.headers);
// pretty print
console.log("Accepted event:");
console.log(JSON.stringify(event.format(), null, 2));
res.status(201)
.send("Event Accepted");
}catch(e) {