Skip to content

Commit

Permalink
add already exists error
Browse files Browse the repository at this point in the history
since it's already outputting a machine error i mapped it to check here instead of the html, since this is probably the only error that users will need to know about
  • Loading branch information
Varrience authored Dec 28, 2024
1 parent bfaaf23 commit ea4f987
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion API/Auth/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ exports.register = async (req, res, next) => {
} catch(error) {
res.status(400).json({
message: "User not successful created",
error: error.message,
error: error.message.includes("E11000") ? "as there is an account already with this name": error.message,
});
}
};
Expand Down

0 comments on commit ea4f987

Please sign in to comment.