We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 358da37 commit 0b25efeCopy full SHA for 0b25efe
shared/src/iosMain/kotlin/helpers/helper.kt
@@ -0,0 +1,10 @@
1
+package helpers
2
+
3
+fun mapToThrowable(errorMap: Map<String, Any?>): Throwable {
4
+ val errorDetails = errorMap["error"] as? Map<String, Any?> ?: return Exception("Unknown error")
5
6
+ val code = errorDetails["code"] as? String ?: "UNKNOWN_ERROR"
7
+ val message = errorDetails["message"] as? String ?: "An unknown error occurred"
8
9
+ return Exception("Stripe Error ($code): $message")
10
+}
0 commit comments