convertPlatformExceptionToFirebaseException function
Never
convertPlatformExceptionToFirebaseException(
- Object exception,
- StackTrace rawStackTrace, {
- required String plugin,
Catches a PlatformException and returns an Exception.
If the Exception is a PlatformException, a FirebaseException is returned.
Implementation
Never convertPlatformExceptionToFirebaseException(
Object exception,
StackTrace rawStackTrace, {
required String plugin,
}) {
var stackTrace = rawStackTrace;
if (stackTrace == StackTrace.empty) {
stackTrace = StackTrace.current;
}
if (exception is! PlatformException) {
Error.throwWithStackTrace(exception, stackTrace);
}
Error.throwWithStackTrace(
platformExceptionToFirebaseException(exception, plugin: plugin),
stackTrace,
);
}