File tree 6 files changed +17
-15
lines changed
firebase-auth/src/jsMain/kotlin/dev/gitlive/firebase/auth
firebase-database/src/jsMain/kotlin/dev/gitlive/firebase/database
firebase-firestore/src/jsMain/kotlin/dev/gitlive/firebase/firestore
firebase-functions/src/jsMain/kotlin/dev/gitlive/firebase/functions
6 files changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -163,8 +163,10 @@ subprojects {
163
163
}
164
164
}
165
165
166
- withType(org.jetbrains.kotlin.gradle.tasks.CInteropProcess ::class ) {
167
- dependsOn(" carthageBootstrap" )
166
+ if (Os .isFamily(Os .FAMILY_MAC )) {
167
+ withType(org.jetbrains.kotlin.gradle.tasks.CInteropProcess ::class ) {
168
+ dependsOn(" carthageBootstrap" )
169
+ }
168
170
}
169
171
170
172
create(" carthageClean" , Delete ::class .java) {
Original file line number Diff line number Diff line change @@ -178,12 +178,12 @@ internal inline fun <R> rethrow(function: () -> R): R {
178
178
return function()
179
179
} catch (e: Exception ) {
180
180
throw e
181
- } catch (e: Throwable ) {
181
+ } catch (e: dynamic ) {
182
182
throw errorToException(e)
183
183
}
184
184
}
185
185
186
- internal fun errorToException (cause : Throwable ) = when (val code = cause.asDynamic(). code as String? ) {
186
+ private fun errorToException (cause : dynamic ) = when (val code = ( cause.code as String? )?.toLowerCase() ) {
187
187
" auth/invalid-user-token" -> FirebaseAuthInvalidUserException (code, cause)
188
188
" auth/requires-recent-login" -> FirebaseAuthRecentLoginRequiredException (code, cause)
189
189
" auth/user-disabled" -> FirebaseAuthInvalidUserException (code, cause)
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ inline fun <R> rethrow(function: () -> R): R {
150
150
return function()
151
151
} catch (e: Exception ) {
152
152
throw e
153
- } catch (e: Throwable ) {
153
+ } catch (e: dynamic ) {
154
154
throw DatabaseException (e)
155
155
}
156
156
}
Original file line number Diff line number Diff line change @@ -387,12 +387,12 @@ inline fun <R> rethrow(function: () -> R): R {
387
387
return function()
388
388
} catch (e: Exception ) {
389
389
throw e
390
- } catch (e: Throwable ) {
390
+ } catch (e: dynamic ) {
391
391
throw errorToException(e)
392
392
}
393
393
}
394
394
395
- fun errorToException (e : Throwable ) = when (e.asDynamic(). code as String? ) {
395
+ fun errorToException (e : dynamic ) = when (e?. code?.toLowerCase() ) {
396
396
" cancelled" -> FirebaseFirestoreException (e, FirestoreExceptionCode .CANCELLED )
397
397
" invalid-argument" -> FirebaseFirestoreException (e, FirestoreExceptionCode .INVALID_ARGUMENT )
398
398
" deadline-exceeded" -> FirebaseFirestoreException (e, FirestoreExceptionCode .DEADLINE_EXCEEDED )
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ inline fun <R> rethrow(function: () -> R): R {
61
61
return function()
62
62
} catch (e: Exception ) {
63
63
throw e
64
- } catch (e: Throwable ) {
65
- throw FirebaseFunctionsException (e.asDynamic(). code as String? , e)
64
+ } catch (e: dynamic ) {
65
+ throw FirebaseFunctionsException (e.code as String? , e)
66
66
}
67
67
}
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ android.useAndroidX=true
6
6
testOptions.unitTests.isIncludeAndroidResources = true
7
7
8
8
# Versions:
9
- firebase-app.version =0.3.0
10
- firebase-auth.version =0.3.0
11
- firebase-common.version =0.3.0
12
- firebase-database.version =0.3.0
13
- firebase-firestore.version =0.3.0
14
- firebase-functions.version =0.3.0
9
+ firebase-app.version =0.3.1
10
+ firebase-auth.version =0.3.1
11
+ firebase-common.version =0.3.1
12
+ firebase-database.version =0.3.1
13
+ firebase-firestore.version =0.3.1
14
+ firebase-functions.version =0.3.1
You can’t perform that action at this time.
0 commit comments