Interactions API: GaosClientException.getMessage() only returns "400 . API error occurred" and omits the server error details
Los mantenedores suelen responder en 1 día
@hemasekhar-p ya está trabajando en esto.
Desde el 5/10/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Environment
com.google.genai:google-genai:1.73.0- Java 21+
Problem Description
When a call to client.interactions.create(...) fails with an HTTP 4xx error (throwing CreateInteractionClientError, a subclass of GaosClientException), Throwable.getMessage() returns only:
400 . API error occurred
The actual diagnostic JSON error body returned by the server (e.g. {"error":{"message":"...","code":"invalid_request"}}) is only accessible if the caller explicitly catches GaosClientException and calls e.bodyAsString().
By comparison, com.google.genai.errors.ApiException (thrown by client.models.*) includes the server's error message directly in getMessage(), making stack traces and logs immediately actionable.
Steps to Reproduce
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateModelInteraction;
import com.google.genai.gaos.models.interactions.GenerationConfig;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Model;
import com.google.genai.gaos.models.interactions.ThinkingLevel;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
public class ErrorRepro {
public static void main(String[] args) {
Client client = Client.builder().build();
var request =
CreateModelInteraction.builder()
.model(Model.GEMINI_3_FLASH_PREVIEW)
.input(InteractionsInput.of("Hello"))
.generationConfig(
GenerationConfig.builder()
.thinkingLevel(ThinkingLevel.MINIMAL) // unsupported on gemini-3-flash-preview
.build())
.build();
// Throws CreateInteractionClientError with message: "400 . API error occurred"
// instead of including: "Thinking level THINKING_LEVEL_MINIMAL is not supported for this model."
client.interactions.create(CreateInteractionRequestBody.of(request));
}
}
Expected Behavior
GaosClientException (and its subclasses like CreateInteractionClientError) should include the server error message or bodyAsString() in getMessage().
- Lenguaje dominante
- Java
- Estrellas
- 398
- Forks
- 126
- Merge medio
- 1 d 12 h
- PR fusionados (30 d)
- 71
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de googleapis/java-genai
-
priority: p2 type: bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
googleapis/java-genai#1372 ·
Los mantenedores suelen responder en 1 día
-
Interactions API: store(false) omits "id", breaking Interaction and InteractionCompletedEvent deserializationPosiblemente ocupada @hemasekhar-p la tomó hace 24 días. Abiertopriority: p2 type: bug
googleapis/java-genai#1281 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Interaction.outputText() always returns Optional.empty() (SDK-computed field is never populated)Posiblemente ocupada @hemasekhar-p la tomó hace 24 días. Abiertopriority: p2 type: bug
googleapis/java-genai#1280 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Gen AI with structured output - `propertyOrdering` in Python vs. Java implementationsPosiblemente ocupada @hemasekhar-p la tomó hace 78 días. Abiertopriority: p3 type: feature request
googleapis/java-genai#1169 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Live API: no way to observe session close or connection errors after setupPosiblemente ocupada @hemasekhar-p la tomó hace 87 días. Abiertopriority: p3 type: feature request
googleapis/java-genai#1153 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de googleapis/java-genai
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
snowflakedb/snowflake-kafka-connector#1610 ·
Los mantenedores suelen responder en 1 día
-
add multipart/form-data exampleAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
swagger-api/swagger-petstore#245 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
liquid-java/liquidjava#443 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
quarkiverse/quarkus-google-cloud-services#1188 ·
Los mantenedores suelen responder en 1 día