How to handle Firebase auth errors on Unity

Viewed 5065

I created a simple password login in my Unity app following the doc and it works fine, however I would like to handle the different kind of errors and since task.Exception doesn't return an error code I don't know how to proceed.

I found this but it doesn't seems to be the same Firebase version since the login method is different...

4 Answers

For me, you guys helped a lot, but I only got part of the way. I was looking to simply get the specific message from the Firebase.FirebaseException when for example an email was not valid or given - simply I wanted the response to go to the screen instead of only to the console.

This fixed it for me:

announcements.text = regTask.Exception.InnerExceptions[0].InnerException.Message;

This "regTask" is the register-user-task: "auth.CreateUserWithEmailAndPasswordAsync(email, password)".

Related