Skip to content

Commit 52263f3

Browse files
committed
Target Wasm JS
Signed-off-by: Matt Ramotar <matt.ramotar@uber.com>
1 parent f5a5bf0 commit 52263f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

store/src/commonMain/kotlin/org/mobilenativefoundation/store/store5/StoreReadResponse.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ sealed class StoreReadResponse<out Output> {
7575
fun requireData(): Output {
7676
return when (this) {
7777
is Data -> value
78-
is Error -> throw this.doThrow()
78+
is Error -> throw this.asThrowable()
7979
else -> throw NullPointerException("there is no data in $this")
8080
}
8181
}
@@ -86,7 +86,7 @@ sealed class StoreReadResponse<out Output> {
8686
*/
8787
fun throwIfError() {
8888
if (this is Error) {
89-
throw this.doThrow()
89+
throw this.asThrowable()
9090
}
9191
}
9292

@@ -165,7 +165,7 @@ sealed class StoreReadResponseOrigin {
165165
object Initial : StoreReadResponseOrigin()
166166
}
167167

168-
fun StoreReadResponse.Error.doThrow(): Throwable {
168+
fun StoreReadResponse.Error.asThrowable(): Throwable {
169169
return when (this) {
170170
is StoreReadResponse.Error.Exception -> error
171171
is StoreReadResponse.Error.Message -> RuntimeException(message)

0 commit comments

Comments
 (0)