V4.6.0 reports fixes (#835)

* Add user network connection issue to ignored errors

* Check current nodes on each app start

* Add user network connection error to ignored errors

* Fix sharing files issue on iOS
This commit is contained in:
Omar Hatem 2023-03-17 21:15:28 +02:00 committed by GitHub
parent df52516964
commit 4027619ad3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 86 additions and 55 deletions

View file

@ -17,13 +17,14 @@ class ExceptionHandler {
static bool _hasError = false;
static const _coolDownDurationInDays = 7;
static void _saveException(String? error, StackTrace? stackTrace) async {
static void _saveException(String? error, StackTrace? stackTrace, {String? library}) async {
final appDocDir = await getApplicationDocumentsDirectory();
final file = File('${appDocDir.path}/error.txt');
final exception = {
"${DateTime.now()}": {
"Error": error,
"Error": "$error\n\n",
"Library": "$library\n\n",
"StackTrace": stackTrace.toString(),
}
};
@ -31,7 +32,7 @@ class ExceptionHandler {
const String separator = '''\n\n==========================================================
==========================================================\n\n''';
await file.writeAsString(
file.writeAsStringSync(
"$exception $separator",
mode: FileMode.append,
);
@ -75,7 +76,11 @@ class ExceptionHandler {
return;
}
_saveException(errorDetails.exception.toString(), errorDetails.stack);
_saveException(
errorDetails.exceptionAsString(),
errorDetails.stack,
library: errorDetails.library,
);
final sharedPrefs = await SharedPreferences.getInstance();
@ -134,6 +139,8 @@ class ExceptionHandler {
"errno = 103", // SocketException: Software caused connection abort
"errno = 104", // SocketException: Connection reset by peer
"errno = 110", // SocketException: Connection timed out
"HttpException: Connection closed before full header was received",
"HandshakeException: Connection terminated during handshake",
"PERMISSION_NOT_GRANTED",
];