Skip to content

Commit

Permalink
Fix proper error response
Browse files Browse the repository at this point in the history
  • Loading branch information
atrifat committed Sep 22, 2023
1 parent c38e92f commit 7910939
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 7910939

Please sign in to comment.