title: SwiftUI Firebase How To Do Custom Error Handling
body: <p>So I'm creating an app that used Firebase as the backend and I want to display the user-specific custom error messages instead of the built-in firebase error messages. How would I do this?</p>
  <pre><code>func signIn(withEmail email: String, password: String){
          
          Auth.auth().signIn(withEmail: email, password: password) { (result,err) in
              if let err = err {
              
                  print(&quot;DEBUG: Failed to login: \(err.localizedDescription)&quot;)
                  return
              }
              self.userSession = result?.user
              self.fetchUser()
              
          }
          
      }
  </code></pre>