I'm trying to handle Firebase errors in Flutter using FlutterFire. Various functions throw FirebaseException, for example if calling an HttpsCallable when there is no internet connection. I need to figure out what to do depending on the error - for example, if there is no internet connection, show a message, else if it's an unknown error log an exception.
The exception has a code to achieve this:
/// The optional code to accommodate the message.
///
/// Allows users to identify the exception from a short code-name, for example
/// "no-app" is used when a user attempts to read a [FirebaseApp] which does
/// not exist.
final String code;
But I can't find anywhere where these codes are documented, which kind of makes them useless. I've searched for ages. Am I missing something? Does anyone have a link? How can I achieve this?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…