Skip to content

Handle IOException gracefully in processProductsInfo to prevent app crashes - #281

Open
cursor[bot] wants to merge 1 commit into
mainfrom
seer/runtimeexception-javanetsocketexception-software-5bx2vh
Open

cursor[bot] wants to merge 1 commit into
mainfrom
seer/runtimeexception-javanetsocketexception-software-5bx2vh

Conversation

@cursor

@cursor cursor Bot commented Oct 22, 2026

Copy link
Copy Markdown

This pull request was triggered by a Seer handoff from Sentry.

Summary

The root cause of the crash was that processProductsInfo() spawns 20 background threads to fetch product information. When network connectivity is lost during these requests, SocketException and other IOException instances were being caught and rethrown as RuntimeException, causing the app to crash since these unhandled exceptions occurred on background threads without an exception handler.

The fix replaces the throw new RuntimeException(e) with proper error handling that logs the exception and reports it to Sentry, allowing the app to continue running gracefully even when network requests fail.

Fixes ANDROID-Q7

Open in Web Open in Cursor 

…rashes

When network connectivity is lost during product info requests, the app
was crashing due to unhandled IOExceptions being rethrown as
RuntimeExceptions on background threads. This change properly handles
the exceptions by logging them and reporting to Sentry instead.

Fixes [ANDROID-Q7](https://demo.sentry.io/issues/7791934984/)
@cursor
cursor Bot requested a review from sdzhong as a code owner October 22, 2026 22:10
@sentry

sentry Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Android com.example.vu.android 24.12.26 (241226) release
Android com.example.vu.android 24.12.26 (241226) debug
Android com.example.vu.android 24.12.26 (241226) release

⚙️ android Build Distribution Settings

@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (21c77a4) to head (2b651da).

Files with missing lines Patch % Lines
.../example/vu/android/empowerplant/MainFragment.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #281   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         16      16           
  Lines        883     884    +1     
  Branches      67      67           
=====================================
- Misses       883     884    +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant