Skip to content

Commit 17837a1

Browse files
committed
Updated iOS exceptions to print better
1 parent b93c124 commit 17837a1

File tree

17 files changed

+32
-28
lines changed

17 files changed

+32
-28
lines changed

build.gradle.kts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ buildscript {
1717
}
1818
}
1919
dependencies {
20-
classpath("com.android.tools.build:gradle:7.0.1")
20+
classpath("com.android.tools.build:gradle:7.0.4")
2121
classpath("com.adarshr:gradle-test-logger-plugin:2.1.1")
2222
}
2323
}
@@ -49,6 +49,9 @@ subprojects {
4949
mavenLocal()
5050
google()
5151
mavenCentral()
52+
maven {
53+
setUrl("https://maven.pkg.jetbrains.space/public/p/kotlinx-coroutines/maven")
54+
}
5255
}
5356

5457
tasks.withType<Sign>().configureEach {
@@ -195,9 +198,9 @@ subprojects {
195198
}
196199

197200
dependencies {
198-
"commonMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
201+
"commonMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1-new-mm-dev2")
199202
"androidMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.5.2")
200-
"androidMainImplementation"(platform("com.google.firebase:firebase-bom:29.0.1"))
203+
"androidMainImplementation"(platform("com.google.firebase:firebase-bom:29.0.3"))
201204
"commonTestImplementation"(kotlin("test-common"))
202205
"commonTestImplementation"(kotlin("test-annotations-common"))
203206
"commonTestImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")

firebase-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-app",
3-
"version": "1.0.0",
3+
"version": "1.4.3",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-app.js",
66
"scripts": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" == 8.8.0
1+
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json" == 8.10.0

firebase-auth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-auth",
3-
"version": "1.0.0",
3+
"version": "1.4.3",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-auth.js",
66
"scripts": {

firebase-auth/src/iosMain/kotlin/dev/gitlive/firebase/auth/auth.kt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ internal suspend inline fun <T> T.await(function: T.(callback: (NSError?) -> Uni
175175
private fun NSError.toException() = when(domain) {
176176
FIRAuthErrorDomain -> when(code) {
177177
FIRAuthErrorCodeInvalidActionCode,
178-
FIRAuthErrorCodeExpiredActionCode -> FirebaseAuthActionCodeException(toString())
178+
FIRAuthErrorCodeExpiredActionCode -> FirebaseAuthActionCodeException(localizedDescription)
179179

180-
FIRAuthErrorCodeInvalidEmail -> FirebaseAuthEmailException(toString())
180+
FIRAuthErrorCodeInvalidEmail -> FirebaseAuthEmailException(localizedDescription)
181181

182182
FIRAuthErrorCodeCaptchaCheckFailed,
183183
FIRAuthErrorCodeInvalidPhoneNumber,
@@ -187,26 +187,26 @@ private fun NSError.toException() = when(domain) {
187187
FIRAuthErrorCodeMissingVerificationID,
188188
FIRAuthErrorCodeMissingVerificationCode,
189189
FIRAuthErrorCodeWeakPassword,
190-
FIRAuthErrorCodeInvalidCredential -> FirebaseAuthInvalidCredentialsException(toString())
190+
FIRAuthErrorCodeInvalidCredential -> FirebaseAuthInvalidCredentialsException(localizedDescription)
191191

192-
FIRAuthErrorCodeInvalidUserToken -> FirebaseAuthInvalidUserException(toString())
192+
FIRAuthErrorCodeInvalidUserToken -> FirebaseAuthInvalidUserException(localizedDescription)
193193

194-
FIRAuthErrorCodeRequiresRecentLogin -> FirebaseAuthRecentLoginRequiredException(toString())
194+
FIRAuthErrorCodeRequiresRecentLogin -> FirebaseAuthRecentLoginRequiredException(localizedDescription)
195195

196196
FIRAuthErrorCodeSecondFactorAlreadyEnrolled,
197197
FIRAuthErrorCodeSecondFactorRequired,
198198
FIRAuthErrorCodeMaximumSecondFactorCountExceeded,
199-
FIRAuthErrorCodeMultiFactorInfoNotFound -> FirebaseAuthMultiFactorException(toString())
199+
FIRAuthErrorCodeMultiFactorInfoNotFound -> FirebaseAuthMultiFactorException(localizedDescription)
200200

201201
FIRAuthErrorCodeEmailAlreadyInUse,
202202
FIRAuthErrorCodeAccountExistsWithDifferentCredential,
203-
FIRAuthErrorCodeCredentialAlreadyInUse -> FirebaseAuthUserCollisionException(toString())
203+
FIRAuthErrorCodeCredentialAlreadyInUse -> FirebaseAuthUserCollisionException(localizedDescription)
204204

205205
FIRAuthErrorCodeWebContextAlreadyPresented,
206206
FIRAuthErrorCodeWebContextCancelled,
207-
FIRAuthErrorCodeWebInternalError -> FirebaseAuthWebException(toString())
207+
FIRAuthErrorCodeWebInternalError -> FirebaseAuthWebException(localizedDescription)
208208

209-
else -> FirebaseAuthException(toString())
209+
else -> FirebaseAuthException(localizedDescription)
210210
}
211-
else -> FirebaseAuthException(toString())
211+
else -> FirebaseAuthException(localizedDescription)
212212
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAuthBinary.json" == 8.8.0
1+
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAuthBinary.json" == 8.10.0

firebase-common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-common",
3-
"version": "1.0.0",
3+
"version": "1.4.3",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-common.js",
66
"scripts": {

firebase-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-config",
3-
"version": "1.0.0",
3+
"version": "1.4.3",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-config.js",
66
"scripts": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json" == 8.8.0
1+
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json" == 8.10.0

firebase-database/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-database",
3-
"version": "1.0.0",
3+
"version": "1.4.3",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-database.js",
66
"scripts": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseDatabaseBinary.json" == 8.8.0
1+
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseDatabaseBinary.json" == 8.10.0

firebase-firestore/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-firestore",
3-
"version": "1.0.0",
3+
"version": "1.4.3",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-firestore.js",
66
"scripts": {

firebase-firestore/src/iosMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ actual open class Query(open val ios: FIRQuery) {
312312

313313
internal actual fun _where(path: FieldPath, inArray: List<Any>?, arrayContainsAny: List<Any>?) = Query(
314314
(inArray?.let { ios.queryWhereFieldPath(path.ios, `in` = it) } ?: ios).let { ios2 ->
315-
arrayContainsAny?.let { ios2.queryWhereFieldPath(path.ios, arrayContainsAny = arrayContainsAny) } ?: ios2
315+
arrayContainsAny?.let { ios2.queryWhereFieldPath(path.ios, arrayContainsAny = arrayContainsAny) } ?: ios
316316
}
317317
)
318318

@@ -408,7 +408,7 @@ fun NSError.toException() = when(domain) {
408408
else -> FirestoreExceptionCode.UNKNOWN
409409
}
410410
else -> FirestoreExceptionCode.UNKNOWN
411-
}.let { FirebaseFirestoreException(description!!, it) }
411+
}.let { FirebaseFirestoreException(localizedDescription!!, it) }
412412

413413
actual class QuerySnapshot(val ios: FIRQuerySnapshot) {
414414
actual val documents
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json" == 8.8.0
1+
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json" == 8.10.0

firebase-functions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gitlive/firebase-functions",
3-
"version": "1.0.0",
3+
"version": "1.4.3",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-functions.js",
66
"scripts": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFunctionsBinary.json" == 8.8.0
1+
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFunctionsBinary.json" == 8.10.0

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ kotlin.js.experimental.generateKotlinExternals=false
99
#kotlin.mpp.enableGranularSourceSetsMetadata=true
1010
kotlin.mpp.stability.nowarn=true
1111
kotlin.native.cacheKind.iosX64=none
12+
kotlin.native.binary.memoryModel=experimental
1213
#kotlin.native.enableDependencyPropagation=false
1314
kotlin.native.enableParallelExecutionCheck=false
1415
kotlin.setJvmTargetFromAndroidCompileOptions=true

0 commit comments

Comments
 (0)