Initial push to my private server
This commit is contained in:
@@ -144,14 +144,28 @@ void main() async {
|
||||
DeviceOrientation.portraitDown,
|
||||
]);
|
||||
runZonedGuarded<Future<void>>(() async {
|
||||
// ... الكود الحالي الموجود في دالة main ...
|
||||
runApp(const MyApp());
|
||||
}, (error, stack) {
|
||||
// أي خطأ غير متوقع في التطبيق سيتم التقاطه هنا CRUD.
|
||||
// ==== START: ERROR FILTER ====
|
||||
String errorString = error.toString();
|
||||
|
||||
// Print all errors to the local debug console for development
|
||||
print("Caught Dart error: $error");
|
||||
print(stack);
|
||||
// أرسل الخطأ إلى السيرفر
|
||||
CRUD.addError(error.toString(), stack.toString(), 'main');
|
||||
|
||||
// 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 ====
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user