Now, at this stage, when you take on the stand and try to create an account, no matter what errors
it will just say failed to create yuzu, this is because somebody mishandled the area, because Santa
failed to create yuzu.
We do not have any validation on each field of the user, so the user will not know why they cannot
create the account.
So now we are going to create a custom error message, for example, for the name since this is required.
We are going to create a custom message that please send her a name and for the email we are going to
type, please send her a email.
And for the unique, we do not need to type anything because it will automatically check for the email
address.
OK, so let me try it for you.
Even though we typed some error here, you will not display the error message and then we go to the
password.
And we type please enter a password, and for the minimum length we type, the password should be at
least six alone alone.
So we also want to check whether this is a redit email.
And we can use this package with data because it already has an effort to check whether this is a email
and it will return, true or false.
And it has also other type of validation, such as is it a BTC address or is it a credit card so we
can go to the portrait and stop the server and then we type NPM install to where the data.
And then we go to the top and angre cornerstone is email equal, require better data, and then we type
with a date and it will track.
If email is false, we will type Creuse into a valid email address.
So if this is an email, you will just like the other, it will return to true.
So now we back to the old controller and we go to the side up functions and then inside the error they
are error message and also error code.
So we don't load these two things so we can try to start the server.
And then this is the account that we already created.
And if we try to send this account.
And you can see it has the error message and this has that duplicate key error correction.
So this is not the same as the error message that we just created.
So this is useless to get their custom message here.
But we can see there is an error.
So later it will depends on this error and we create and custom methods.
So now we try to delete Gmail.
So this is not a relevant email and we also delete some character.
So this is not fulfilled.
At least six Karatas long.
And then we send this to the server and now we will back to the server and you will see there are two
error message.
One is for the e-mail peace and a relet email address, and this is what we typed here, and for the
password, the password should be a Cavitat launch.
And for this area, the error is undefined.
So in the off controller, instead of handling all the errors here, we are going to create and other
functions to handle this error.