{"record":{"id":"f952722f061add15","repo":"HKUDS/nanobot","slug":"label-returned-no-images-provider-error","errorCode":null,"errorMessage":"{label} returned no images: {provider_error}","messagePattern":"(.+?) returned no images: (.+?)","errorType":"exception","errorClass":"ImageGenerationError","httpStatus":null,"severity":"error","filePath":"nanobot/providers/image_generation.py","lineNumber":334,"sourceCode":"\n    @abstractmethod\n    async def generate(\n        self,\n        *,\n        prompt: str,\n        model: str,\n        reference_images: list[str] | None = None,\n        aspect_ratio: str | None = None,\n        image_size: str | None = None,\n    ) -> GeneratedImageResponse: ...\n\n    def _require_images(self, images: list[str], data: dict[str, Any]) -> None:\n        if images:\n            return\n        provider_error = data.get(\"error\")\n        label = self.provider_name\n        if provider_error:\n            raise ImageGenerationError(f\"{label} returned no images: {provider_error}\")\n        raise ImageGenerationError(f\"{label} returned no images for this request\")\n\n    def _http_client_kwargs(self) -> dict[str, Any]:\n        kwargs: dict[str, Any] = {\"timeout\": self.timeout}\n        if self.proxy:\n            kwargs[\"proxy\"] = self.proxy\n            kwargs[\"trust_env\"] = False\n        return kwargs\n\n    async def _http_post(\n        self,\n        url: str,\n        *,\n        headers: dict[str, str],\n        body: dict[str, Any],\n        client: httpx.AsyncClient | None = None,\n    ) -> httpx.Response:\n        if client is not None:","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/providers/image_generation.py#L316-L352","documentation":"Shared result guard _require_images: a provider response yielded an empty image list AND the payload contained an error field. The provider explicitly reported a failure alongside no images; the error text is surfaced verbatim via {provider_error} prefixed with the provider name.","triggerScenarios":"Thrown at nanobot/providers/image_generation.py:334 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Follow the embedded provider error (usually auth, quota, or content-policy rejection)","Retry if the error indicates a transient condition","Adjust prompt/parameters if the error flags a policy violation"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","contentChangedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}