Add error handling to re-throw Stripe POST errors.
This commit is contained in:
parent
e6f28c6cdd
commit
599caee229
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue