Skip to content

Commit

Permalink
chore: add finally
Browse files Browse the repository at this point in the history
  • Loading branch information
kyY00n committed May 1, 2024
1 parent 063f54a commit 8437b7f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/middlewares/errorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ const errHandler = (
.then(() => {})
.catch(error => {
console.error(error);
})
.finally(() => {
return res
.status(statusCode.INTERNAL_SERVER_ERROR)
.send(
util.fail(statusCode.INTERNAL_SERVER_ERROR, (err as Error).message)
);
});

return res
.status(statusCode.INTERNAL_SERVER_ERROR)
.send(util.fail(statusCode.INTERNAL_SERVER_ERROR, (err as Error).message));
};

export default errHandler;

0 comments on commit 8437b7f

Please sign in to comment.