diff --git a/donations/lib/src/main/java/org/signal/donations/StripeApi.kt b/donations/lib/src/main/java/org/signal/donations/StripeApi.kt index 70283f7f2..2f626ef7f 100644 --- a/donations/lib/src/main/java/org/signal/donations/StripeApi.kt +++ b/donations/lib/src/main/java/org/signal/donations/StripeApi.kt @@ -135,6 +135,8 @@ class StripeApi( objectMapper.readValue(it.body()!!.string()) } catch (e: InvalidDefinitionException) { throw StripeError.FailedToParseSetupIntentResponseError(e) + } catch (e: StripeError.PostError) { + throw e } catch (e: Exception) { throw StripeError.FailedToParseSetupIntentResponseError(null) } @@ -153,6 +155,8 @@ class StripeApi( objectMapper.readValue(it.body()!!.string()) } catch (e: InvalidDefinitionException) { throw StripeError.FailedToParsePaymentIntentResponseError(e) + } catch (e: StripeError.PostError) { + throw e } catch (e: Exception) { throw StripeError.FailedToParsePaymentIntentResponseError(null) }