You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(onramp): typed error hierarchy for Coinbase API errors
Replace CoinbaseOnRampApiError data class with a sealed class hierarchy
so each error type (GuestRegionForbidden, GuestTransactionLimit, etc.)
gets its own class name for distinct grouping in Bugsnag. Uses a private
DTO for JSON deserialization with all-nullable fields, fixing parsing of
real Coinbase responses that lack the old required code/message fields.
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
Copy file name to clipboardExpand all lines: apps/flipcash/shared/onramp/coinbase/src/test/kotlin/com/flipcash/app/onramp/CoinbaseOnRampControllerTest.kt
+58Lines changed: 58 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -175,3 +175,61 @@ class CoinbaseOnRampControllerTest {
175
175
176
176
// endregion
177
177
}
178
+
179
+
classCoinbaseOnRampApiErrorParseTest {
180
+
181
+
@Test
182
+
fun`parse real Coinbase error response with errorType`() {
183
+
val body ="""{"correlationId":"9f42a272080a4bc3-IAD","errorLink":"https://docs.cdp.coinbase.com/api-reference/v2/errors","errorType":"guest_region_forbidden"}"""
0 commit comments