PlatformService.executeIfSupportedAsync - HandshakeException crash#4531
PlatformService.executeIfSupportedAsync - HandshakeException crash#4531
Conversation
Prevent crash when HandshakeException occurs during platform-specific async operations (e.g. analytics, Intercom) by catching and returning fallback value. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request addresses a crash caused by an unhandled HandshakeException during asynchronous platform-specific operations. The fix involves adding a try-catch block to gracefully handle this exception and return a fallback value. I've suggested a small improvement to make the error handling more robust by catching the more general IOException, which would prevent similar crashes from other network-related issues.
| return await function(); | ||
| try { | ||
| return await function(); | ||
| } on HandshakeException { |
There was a problem hiding this comment.
While catching HandshakeException fixes the specific crash reported, it would be more robust to catch the more general IOException. This would handle other network-related errors as well, such as SocketException (e.g., no internet connection) or other I/O errors, which seems to align with the goal of gracefully handling "network issues" as mentioned in the test plan. HandshakeException itself is a subtype of IOException.
| } on HandshakeException { | |
| } on IOException { |
|
closed in #4628 |
|
Hey @aaravgarg 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! 💜 |
Summary
HandshakeExceptioninPlatformService.executeIfSupportedAsyncto prevent crashCrash Stats
Test plan
🤖 Generated with Claude Code