Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions aibd/cli/src/main/java/com/example/cahier/aibd/cli/Cli.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.example.cahier.aibd.core.ImagePayloadConverter
import com.example.cahier.tools.Adb
import com.example.cahier.tools.DesktopDeployer
import com.example.cahier.tools.RealAdb
import com.google.genai.errors.ClientException
import com.google.genai.errors.GenAiIOException
import com.google.genai.types.Part
import java.io.File
Expand Down Expand Up @@ -150,6 +151,15 @@ fun <R> runWithSpinnerAndCancel(
val result = runBlocking { deferred.await() }
spinner.stop(true)
return result
} catch (e: ClientException) {
spinner.stop(false)
harness.revertChatState()
println(
"Active Gemini request failed. Chat history reverted. Failure reason:\n${e.message}\n\n" +
"Please try again."
)
harness.log("Gemini request failed: ${e.message}")
return null
} catch (e: GenAiIOException) {
spinner.stop(false)
harness.revertChatState()
Expand Down
Loading