mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-02 12:14:09 +01: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:
@@ -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",
|
||||
];
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ import 'package:share_plus/share_plus.dart';
|
||||
import 'package:cross_file/cross_file.dart';
|
||||
|
||||
class ShareUtil {
|
||||
static const _mimeType = 'application/*';
|
||||
|
||||
static void share({required String text, required BuildContext context}) {
|
||||
Share.share(
|
||||
text,
|
||||
@@ -17,7 +15,8 @@ class ShareUtil {
|
||||
required String fileName,
|
||||
required BuildContext context,
|
||||
}) async {
|
||||
Share.shareXFiles(
|
||||
const _mimeType = 'application/*';
|
||||
await Share.shareXFiles(
|
||||
<XFile>[
|
||||
XFile(
|
||||
filePath,
|
||||
|
||||
Reference in New Issue
Block a user