File tree Expand file tree Collapse file tree 5 files changed +13
-13
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 Expand file tree Collapse file tree 5 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -87,12 +87,12 @@ private inline fun <R> rethrow(function: () -> R): R {
87
87
return function()
88
88
} catch (e: Exception ) {
89
89
throw e
90
- } catch (e: Throwable ) {
90
+ } catch (e: dynamic ) {
91
91
throw errorToException(e)
92
92
}
93
93
}
94
94
95
- private fun errorToException (cause : Throwable ) = when (val code = cause.asDynamic(). code as String? ) {
95
+ private fun errorToException (cause : dynamic ) = when (val code = ( cause.code as String? )?.toLowerCase() ) {
96
96
" auth/invalid-user-token" -> FirebaseAuthInvalidUserException (code, cause)
97
97
" auth/requires-recent-login" -> FirebaseAuthRecentLoginRequiredException (code, cause)
98
98
" 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