Initial push to my private server
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:Intaleq/controller/functions/crud.dart';
|
||||
import 'package:Intaleq/controller/payment/paymob/paymob_response.dart';
|
||||
import 'package:Intaleq/views/home/HomePage/contact_us.dart';
|
||||
import 'package:Intaleq/views/home/HomePage/share_app_page.dart';
|
||||
@@ -133,7 +135,30 @@ void main() async {
|
||||
),
|
||||
]);
|
||||
|
||||
runApp(const MyApp());
|
||||
runZonedGuarded<Future<void>>(() async {
|
||||
runApp(const MyApp());
|
||||
}, (error, stack) {
|
||||
// ==== START: ERROR FILTER ====
|
||||
String errorString = error.toString();
|
||||
|
||||
// Print all errors to the local debug console for development
|
||||
print("Caught Dart error: $error");
|
||||
print(stack);
|
||||
|
||||
// We will check if the error contains keywords for errors we want to ignore.
|
||||
// If it's one of them, we will NOT send it to the server.
|
||||
bool isIgnoredError = errorString.contains('PERMISSION_DENIED') ||
|
||||
errorString.contains('FormatException') ||
|
||||
errorString.contains('Null check operator used on a null value');
|
||||
|
||||
if (!isIgnoredError) {
|
||||
// Only send the error to the server if it's not in our ignore list.
|
||||
CRUD.addError(error.toString(), stack.toString(), 'main');
|
||||
} else {
|
||||
print("Ignoring error and not sending to server: $errorString");
|
||||
}
|
||||
// ==== END: ERROR FILTER ====
|
||||
});
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
|
||||
Reference in New Issue
Block a user