mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
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:
parent
df52516964
commit
4027619ad3
8 changed files with 86 additions and 55 deletions
|
@ -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",
|
||||
];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue