Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/lib/services/sockets/pure_socket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ class PureSocket implements IPureSocket {
});

_listener?.onError(err, trace);
PlatformManager.instance.crashReporter.reportCrash(err, trace);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Completely removing crash reporting is too broad and can hide legitimate application bugs. For instance, an exception in an onMessage handler would be caught here but would no longer be reported. It's better to conditionally report crashes, filtering out expected network errors like SocketException and WebSocketChannelException.

    // Only report unexpected errors as crashes, not common network issues.
    if (err is! SocketException && err is! WebSocketChannelException) {
      PlatformManager.instance.crashReporter.reportCrash(err, trace);
    }

if (err is! SocketException && err is! WebSocketChannelException) {
PlatformManager.instance.crashReporter.reportCrash(err, trace);
}
}

@override
Expand Down