angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

createUserWithEmailAndPassword exception propagates to global handler

Open jzburns opened this issue 3 years ago • 1 comments
trafficstars

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

** 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

jzburns avatar Jan 21 '22 10:01 jzburns

Still facing the same problem, please let us know if someone found a solution

BaraaHalabiTr avatar Aug 13 '22 16:08 BaraaHalabiTr

I also encounter this problem, the authentication error caught successfully is still thrown.

LihaoFan3 avatar Oct 14 '22 12:10 LihaoFan3

Still facing this as well. It was originally reported in 2019 and closed as a known issue with no resolution steps. There are no workarounds or documentation on the issue from the team.

Any word on this as it makes using error tracking like Sentry harder once it hits the global error handler as an unhandled exception?

kraighamady avatar May 23 '23 17:05 kraighamady