---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/generation/gemini/exceptions/variables/E_GEMINI_GENERATION_MALFORMED_RESPONSE.md
description: >-
  Thrown when a 2xx response body cannot be parsed into the expected
  candidates/parts shape, or when it contains zero image parts (e.g. a safety
  refusal returning text only). In the zero-image case the detail string
  includes any text parts' content so refusals surface legibly. Non-fatal.
  Printf arg: `[detail]`.
---

# Variable: E\_GEMINI\_GENERATION\_MALFORMED\_RESPONSE

```ts
const E_GEMINI_GENERATION_MALFORMED_RESPONSE: CreatedException<[string]>;
```

Defined in: [src/batteries/generation/gemini/exceptions.ts:62](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/generation/gemini/exceptions.ts#L62)

Thrown when a 2xx response body cannot be parsed into the expected candidates/parts shape, or
when it contains zero image parts (e.g. a safety refusal returning text only). In the
zero-image case the detail string includes any text parts' content so refusals surface legibly.
Non-fatal. Printf arg: `[detail]`.
