Skip to content

Commit

Permalink
download: Use standard HTTP status numbers
Browse files Browse the repository at this point in the history
Also, give an error that's now a plain '500' a more specific message.
  • Loading branch information
DeeDeeG committed Feb 3, 2024
1 parent da5d13c commit 2dea642
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions microservices/download/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ const server = http.createServer(async (req, res) => {

if (!validatedParams.os || !validatedParams.type) {
await utils.displayError(req, res, {
code: 503,
code: 400,
msg: "Required Download Parameters Missing or Invalid"
});
console.log("Download Returned 503 due to missing or invalid os or type");
console.log("Download Returned 400 due to missing or invalid os or type");
return;
}

Expand Down
4 changes: 2 additions & 2 deletions microservices/download/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ async function findLink(os, type) {
console.log(err);
return {
ok: false,
code: 505,
msg: "Server Error"
code: 500,
msg: "Server Error While Finding Link"
};
}
}
Expand Down

0 comments on commit 2dea642

Please sign in to comment.