It is possible to export a catch error in javascript?

i´m doing a webapp using react, it is a journalApp with a backend in firebase, im trying to make a display message on the login screen when the email is not registered in firebase, my question is if there is a way to use the catch error when the mail is not registered.Here is the message that i want to show This is the code that generates the error

Thanks to all!

Answer

Yes of course! you are able to run any code in the catch block. Try the following:

export const startLOginEmailPassword = (email, password) => {
  return (dispatch) => {
    firebase.auth().signInWithEmailAndPassword(email, password)
      .then(({user}) => dispatch( login(user.uid, user.displayName)))
      .catch(e => {
        console.log(e);
        alert(e.message);
       });
   }
}