I created app in flutter and authentication using FirebaseAuth where the UI and AuthApi files are separated when user press signup button it runs an async function which is in the other file. so if any error occurred then i want to access that firebase exception in UI file. here is code.
ui.dart file
try{
await authFunc();
}catch(e){
//
}
authApi.dart
Future<void> authFunc() async{
try{
// FirebaseAuth functions
} on FirebaseException (e){
// i want to catch this exception on ui side async func
// rethrow didn't catch the error
}
}