angular / angular/angularfire

createUserWithEmailAndPassword exception propagates to global handler

Ouverte
#3,129 3 commentaires 4 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
TypeScript
Étoiles
7.8k
Forks
2.2k
Merge moyen
22 h 28 min
PR mergées (30 j)
6

Description

### Version info

**Angular:**
angular/core: "~13.1.0",

**Firebase:**
"firebase": "^9.6.3",

**AngularFire:**
angular/fire: "^7.2.0",

**Other (e.g. Ionic/Cordova, Node, browser, operating system):**
Windows 10, Node.js v16.13.2., Edge and Chrome, latest version

### How to reproduce these conditions
Using the ``compat`` layer

```
import {AngularFireAuth} from '@angular/fire/compat/auth';
// etc

// choose an email address that is already in use, this throws the exception auth/email-already-in-use as expected
this.angularFireAuth.createUserWithEmailAndPassword(email, passwd).then((userCredential) => {
// user create was successful
}).catch((error) => {
console.log(error);
// even though we catch auth/email-already-in-use
// the error still propagates to the global error handler
// and appears on the console
// see the screenshot
});
```

See [this thread on stackoverflow where the question was asked already](https://stackoverflow.com/questions/67580158/cant-catch-exception-in-angularfireauth)

** Screenshots **
image

### Expected behavior

The exception that is caught in the catch block should not make its way to the global error handler

### Actual behavior

The exception that we caught in the catch block still propagates up to the global error handler

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez au point d’entrée @angular/fire/compat/auth et reproduisez le problème avec createUserWithEmailAndPassword en utilisant une adresse e-mail déjà enregistrée. Suivez l’erreur auth/email-already-in-use interceptée et comparez le comportement de promise catch avec le gestionnaire d’erreurs global. Le travail est terminé lorsque l’exception interceptée n’atteint plus le gestionnaire d’erreurs global ni la console.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, firebase, typescript
Domaine
authentication, frontend
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.