Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relay error message on PaymentResult.Failed #4512

Merged
merged 3 commits into from
Jan 20, 2022
Merged

Conversation

brnunes-stripe
Copy link
Contributor

Summary

Instead of wrapping the errors with an IllegalArgumentException, relay the original Throwable. That way we preserve the localized message (although it's not guaranteed that it'll be localized).
Besides, "Failed to confirm intent" doesn't add any helpful information.

Motivation

RUN_MOBILESDK-678

Testing

  • Added tests
  • Modified tests
  • Manually verified

@github-actions
Copy link
Contributor

github-actions bot commented Jan 19, 2022

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: none)
NEW: paymentsheet-example-release-pr.apk (signature: none)

          │          compressed           │         uncompressed          
          ├───────────┬───────────┬───────┼───────────┬───────────┬───────
 APK      │ old       │ new       │ diff  │ old       │ new       │ diff  
──────────┼───────────┼───────────┼───────┼───────────┼───────────┼───────
      dex │  11.9 MiB │  11.9 MiB │ +47 B │  40.4 MiB │  40.4 MiB │ -68 B 
     arsc │   1.6 MiB │   1.6 MiB │   0 B │   1.6 MiB │   1.6 MiB │   0 B 
 manifest │   2.6 KiB │   2.6 KiB │   0 B │  10.8 KiB │  10.8 KiB │   0 B 
      res │ 697.1 KiB │ 697.1 KiB │   0 B │   1.1 MiB │   1.1 MiB │   0 B 
    asset │  77.7 KiB │  77.7 KiB │   0 B │ 109.2 KiB │ 109.2 KiB │   0 B 
    other │  78.3 KiB │  78.3 KiB │  +2 B │   154 KiB │   154 KiB │   0 B 
──────────┼───────────┼───────────┼───────┼───────────┼───────────┼───────
    total │  14.3 MiB │  14.3 MiB │ +49 B │  43.3 MiB │  43.3 MiB │ -68 B 


         │          raw           │            unique            
         ├────────┬────────┬──────┼────────┬────────┬────────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff       
─────────┼────────┼────────┼──────┼────────┼────────┼────────────
   files │      3 │      3 │    0 │        │        │            
 strings │ 188175 │ 188174 │   -1 │ 170172 │ 170171 │ -1 (+1 -2) 
   types │  32855 │  32855 │    0 │  30848 │  30848 │  0 (+0 -0) 
 classes │  28463 │  28463 │    0 │  28463 │  28463 │  0 (+0 -0) 
 methods │ 165291 │ 165291 │    0 │ 160395 │ 160395 │  0 (+0 -0) 
  fields │ 121281 │ 121281 │    0 │ 120608 │ 120608 │  0 (+0 -0) 


 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  297 │  297 │  0   
 entries │ 5387 │ 5387 │  0
APK
   compressed    │  uncompressed   │                                                       
─────────┬───────┼─────────┬───────┤                                                       
 size    │ diff  │ size    │ diff  │ path                                                  
─────────┼───────┼─────────┼───────┼───────────────────────────────────────────────────────
 2.7 MiB │ +47 B │ 7.7 MiB │ -68 B │ ∆ classes2.dex                                        
   186 B │  +2 B │     6 B │   0 B │ ∆ META-INF/androidx.activity_activity-compose.version 
─────────┼───────┼─────────┼───────┼───────────────────────────────────────────────────────
 2.7 MiB │ +49 B │ 7.7 MiB │ -68 B │ (total)
DEX
STRINGS:

   old    │ new    │ diff       
  ────────┼────────┼────────────
   170172 │ 170171 │ -1 (+1 -2) 
  
  + SMAP
  DefaultFlowController.kt
  Kotlin
  *S Kotlin
  *F
  + 1 DefaultFlowController.kt
  com/stripe/android/paymentsheet/flowcontroller/DefaultFlowController
  + 2 _Collections.kt
  kotlin/collections/CollectionsKt___CollectionsKt
  *L
  1#1,508:1
  286#2,2:509
  *S KotlinDebug
  *F
  + 1 DefaultFlowController.kt
  com/stripe/android/paymentsheet/flowcontroller/DefaultFlowController
  *L
  359#1:509,2
  *E
  
  
  - Failed to confirm intent: 
  - SMAP
  DefaultFlowController.kt
  Kotlin
  *S Kotlin
  *F
  + 1 DefaultFlowController.kt
  com/stripe/android/paymentsheet/flowcontroller/DefaultFlowController
  + 2 _Collections.kt
  kotlin/collections/CollectionsKt___CollectionsKt
  *L
  1#1,510:1
  286#2,2:511
  *S KotlinDebug
  *F
  + 1 DefaultFlowController.kt
  com/stripe/android/paymentsheet/flowcontroller/DefaultFlowController
  *L
  359#1:511,2
  *E

skyler-stripe
skyler-stripe previously approved these changes Jan 19, 2022
@brnunes-stripe brnunes-stripe merged commit 8bdd235 into master Jan 20, 2022
@brnunes-stripe brnunes-stripe deleted the brnunes/error branch January 20, 2022 00:04
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.

3 participants