Skip to content

Commit

Permalink
log-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
uriva committed Feb 25, 2024
1 parent cf01688 commit d003264
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/taskBouncer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ const bouncer = (
if (req.method === "POST" && req.url === "/") {
getJson<Task>(req)
.then(deferredHandler)
.then(() => success(res, null));
.then(() => success(res, null))
.catch((e) => {
console.error(e);
res.writeHead(500);
res.end();
});
return;
}
const params = req.method === "POST"
Expand All @@ -65,7 +70,6 @@ const bouncer = (
);
},
).catch((e: Error) => {
console.error(`Failed to process bounced message: ${e.message}`);
console.error(e);
res.writeHead(500);
res.end();
Expand Down

0 comments on commit d003264

Please sign in to comment.