nativescript-plugin-firebase
                                
                                 nativescript-plugin-firebase copied to clipboard
                                
                                    nativescript-plugin-firebase copied to clipboard
                            
                            
                            
                        Plugin swallows original error object from API call, throws a customized string in English.
I am using authentication module with the "native api".
Simple example demonstrating this issue is trying to do a password login with an email that doesn't exist:
Using the Firebase's original web API on a web page, this is what is thrown:
{code: "auth/user-not-found", message: "There is no user record corresponding to this identifier. The user may have been deleted."}
Using the nativescript-plugin-firebase, a string is thrown:
'Logging in the user failed. com.google.firebase.auth.FirebaseAuthInvalidUserException: There is no user record corresponding to this identifier. The user may have been deleted.'
As they are, plugin error messages are not suitable to show to the user of the app (com.google.firebase.auth.FirebaseAuthInvalidUserException stuff). Moreover, the application I am working on is not in English, so I need to get the meaning of the errors and translate them before showing them to the user. This is quite straightforward using the original API, as I only look for the error code and map them to an error message in the target language.
Is there any way to receive authentic error structure (with code and message) instead of just a customized English text? If not, can I request this feature? :)
I can of course try to generate all of the errors to see their message section and search and map them in the error strings returned by the plugin but this is fragile as you or Firebase team may fix typos or change messages anytime. It is also time consuming and should not be necessary as Firebase has an excellent documentation of their API, including the errors. Should I go this way at least for now?
Happy to improve this code, but I don't see how: https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/5d736f90dc8f4c46e576542398601e2570478d31/src/firebase.android.ts#L857
I guess similar to #386
Any news in 2021?