I have small problem, but I don't know what I doing wrong. I have function like below. In .catch alert working ok and I see error in browser, but I have problem with this same error in console.log <- I don't see anything Basically, I wanted to pass error to another function like notify(error) but I don't see anything.
const signIn = (e) => {
e.preventDefault();
signInWithEmailAndPassword(auth, email, password)
.then(() => {
navigate("/");
})
.catch((error) => {
// notify(error)
console.log("error: ", error);
alert(error);
});
};
I try doing try catch and async await but I have the same problem:
async function signIn(e) {
try {
e.preventDefault();
await signInWithEmailAndPassword(auth, email, password).then(() => {
navigate("/");
});
} catch (error) {
// notify(error);
console.error("error: ", error);
alert(err);
}
}