Skip to content

Fix ANDROID-DN: Remove deliberate exception in processDeliveryItem#204

Draft
cursor[bot] wants to merge 1 commit intomainfrom
mainfragmentbackendapiexception-failed-to-eoqv92
Draft

Fix ANDROID-DN: Remove deliberate exception in processDeliveryItem#204
cursor[bot] wants to merge 1 commit intomainfrom
mainfragmentbackendapiexception-failed-to-eoqv92

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor bot commented Mar 24, 2026

Summary

Fixes ANDROID-DN - MainFragment$BackendAPIException: Failed to init delivery workflow

Problem

The processDeliveryItem method was deliberately throwing a BackendAPIException when called during checkout failures. This was causing unnecessary exception reports to Sentry when the real issue is a backend failure (not an Android app issue).

Solution

Changed the method to gracefully handle checkout failures by:

  • Logging a warning instead of throwing an exception
  • Setting the span status to ABORTED instead of INTERNAL_ERROR
  • Removing the deliberate exception throw and catch block

Impact

  • Prevents false-positive error reports in Sentry for Android app
  • Still properly tracks that the delivery workflow was skipped due to checkout failure
  • Improves error handling and reduces noise in error monitoring

Testing

The fix removes a deliberately thrown exception that was always being triggered on checkout failures, replacing it with proper error handling using span status tracking.

Open in Web Open in Cursor 

Fixes ANDROID-DN

The processDeliveryItem method was deliberately throwing a
BackendAPIException when called during checkout failures. This
was causing unnecessary exception reports to Sentry when the
real issue is a backend failure.

Changed to gracefully handle the checkout failure by:
- Logging a warning instead of error
- Setting span status to ABORTED instead of INTERNAL_ERROR
- Removing the deliberate exception throw

This prevents false-positive error reports while still properly
tracking that the delivery workflow was skipped due to checkout
failure.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

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

Files with missing lines Patch % Lines
.../example/vu/android/empowerplant/MainFragment.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main    #204   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         16      16           
  Lines        864     858    -6     
  Branches      65      64    -1     
=====================================
+ Misses       864     858    -6     

☔ View full report in Codecov by Sentry.
📢 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