Skip to content

Commit

Permalink
Cleanup and add descriptions to Turbo load errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jayohms committed Feb 27, 2024
1 parent a28816f commit b7b1e54
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions turbo/src/main/kotlin/dev/hotwire/turbo/errors/LoadError.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
package dev.hotwire.turbo.errors

sealed interface LoadError : TurboVisitError {
data object NotPresent : LoadError
data object NotReady : LoadError
val description: String

data object NotPresent : LoadError {
override val description = "Turbo Not Present"
}

data object NotReady : LoadError {
override val description = "Turbo Not Ready"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class TurboSession internal constructor(
"visitRequestFailedWithStatusCode",
"visitIdentifier" to visitIdentifier,
"visitHasCachedSnapshot" to visitHasCachedSnapshot,
"statusCode" to statusCode
"error" to visitError
)

currentVisit?.let { visit ->
Expand Down

0 comments on commit b7b1e54

Please sign in to comment.