Skip to content

Commit

Permalink
ADD :: error
Browse files Browse the repository at this point in the history
  • Loading branch information
anys34 committed Aug 27, 2023
1 parent 9334880 commit a4f3110
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions routes/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,19 @@ router.get("/:id", async (req, res) => {
commit: commit,
});
if (user_Info.length > 0) {
return res.send(user_Info);
return res.status(200).send(user_Info);
}
if (!(user_Info.length > 0)) {
return res.send("not found");
return res.status(500).send("not found");
}
} catch (error) {
console.log(error);
res.status(500).send(error);
console.log(error.response.status);
if (error.response.status == 404) {
return res.status(200).send("not found");
}
if (error.response.status != 404) {
return res.status(500).send(error);
}
}
});

Expand Down

0 comments on commit a4f3110

Please sign in to comment.