Skip to content

Commit

Permalink
Merge pull request #4 from atrifat/fix-proper-error-response
Browse files Browse the repository at this point in the history
Fix proper error response
  • Loading branch information
atrifat authored Sep 22, 2023
2 parents c38e92f + 7910939 commit d66a805
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const loadBalancerHandler = async (req, res) => {
console.error(err);
const statusCode = err.response ? err.response.status : 500;
const message = err.response ? typeof err.response.data.message ? err.response.data.message : err.response.reason.message || err.response.code || err.message || "Server error!" : "Server error!";
res.status(statusCode).send(message);
res.status(statusCode).header(err.response.headers).send(message);
}
}

Expand Down

0 comments on commit d66a805

Please sign in to comment.