opt: notify-debugger-on-exception (#1750)

This commit is contained in:
My-Responsitories
2025-11-17 21:49:36 +08:00
committed by GitHub
parent 76c2de4394
commit 0f8166620e
14 changed files with 37 additions and 74 deletions

View File

@@ -210,6 +210,7 @@ class LiveMessageStream {
}
}
@pragma('vm:notify-debugger-on-exception')
void _processingData(List<int> data) {
try {
final subHeader = PackageHeaderRes.fromBytesData(
@@ -226,9 +227,7 @@ class LiveMessageStream {
_processingData(data.sublist(subHeader.totalSize));
}
}
} catch (_) {
if (kDebugMode) rethrow;
}
} catch (_) {}
}
Future<void> _heartBeat() async {
@@ -267,6 +266,7 @@ class LiveMessageStream {
_eventListeners.add(func);
}
@pragma('vm:notify-debugger-on-exception')
void onData(dynamic data) {
final header = PackageHeaderRes.fromBytesData(data as Uint8List);
if (header != null) {
@@ -292,9 +292,7 @@ class LiveMessageStream {
//debugPrint('Body: ${utf8.decode()}');
}
_processingData(decompressedData);
} catch (_) {
if (kDebugMode) rethrow;
}
} catch (_) {}
}
}