{"record":{"id":"914bcd854201005c","repo":"xtekky/gpt4free","slug":"yupp-request-failed-str-e","errorCode":null,"errorMessage":"Yupp request failed: {str(e)}","messagePattern":"Yupp request failed: (.+?)","errorType":"exception","errorClass":"ProviderException","httpStatus":null,"severity":"error","filePath":"g4f/Provider/Yupp.py","lineNumber":791,"sourceCode":"                # Check for token-related errors in generic exceptions too\n                if any(x in error_str for x in [\"404\", \"401\", \"403\", \"invalid action\"]):\n                    token_type = (\n                        \"new_conversation\"\n                        if is_new_conversation\n                        else \"existing_conversation\"\n                    )\n                    await token_extractor.mark_token_failed(token_type, next_action)\n                    log_debug(\n                        f\"Token failure detected in exception handler: {token_type}\"\n                    )\n\n                if \"500\" in error_str or \"internal server error\" in error_str:\n                    async with account_rotation_lock:\n                        account[\"error_count\"] += 1\n                    continue\n                async with account_rotation_lock:\n                    account[\"error_count\"] += 1\n                raise ProviderException(f\"Yupp request failed: {str(e)}\") from e\n\n        raise ProviderException(\"All Yupp accounts failed after rotation attempts\")\n\n    @classmethod\n    async def _process_stream_response(\n        cls,\n        response,\n        account: Dict[str, Any],\n        scraper: CloudScraper,\n        prompt: str,\n        model_id: str,\n    ) -> AsyncResult:\n        line_pattern = re.compile(b\"^([0-9a-fA-F]+):(.*)\")\n        target_stream_id = None\n        reward_info = None\n        is_thinking = False\n        thinking_content = \"\"\n        normal_content = \"\"","sourceCodeStart":773,"sourceCodeEnd":809,"githubUrl":"https://github.com/xtekky/gpt4free/blob/973504e1770928ed5fb82f43da528f441ad9ddc3/g4f/Provider/Yupp.py#L773-L809","documentation":"Raised as ProviderException (wrapping the original exception) in Yupp's exception handler after a request attempt fails with an error that is neither a detected token failure nor a 500/internal-server-error (those cases rotate accounts and continue). It signals a request-level failure — network error, unexpected status, or response parsing problem — attributed to the current account.","triggerScenarios":"Any exception escaping the try block around scraper request/response processing that doesn't match the retryable patterns: e.g. aiohttp connection reset, Cloudflare block page parsed unexpectedly, malformed SSE payload in _process_stream_response, or a 4xx status.","commonSituations":"Transient network drops, Cloudflare challenge changes that cloudscraper can't solve, or upstream Yupp API contract changes breaking response parsing.","solutions":["Inspect the wrapped original exception via the __cause__ chain to identify the real failure","Update cloudscraper to the latest version (Cloudflare bypass rules go stale)","Retry with backoff for transient network errors","Rotate to fresh Yupp tokens or another provider if the error persists"],"exampleFix":"try:\n    resp = await client.chat.completions.create(model='gpt-4o', provider='Yupp', messages=msgs)\nexcept ProviderException as e:\n    log.error('Yupp failed: %s (cause: %r)', e, e.__cause__)","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    resp = await create(..., provider='Yupp')\nexcept ProviderException as e:\n    cause = e.__cause__\n    if isinstance(cause, (aiohttp.ClientConnectorError, TimeoutError)):\n        await asyncio.sleep(backoff); retry()  # transient\n    else:\n        raise  # inspect cause before deciding","preventionTips":["Always inspect __cause__ to distinguish network vs parsing failures","Keep cloudscraper updated for current Cloudflare bypass rules","Wrap Yupp calls in bounded retry with exponential backoff"],"tags":["yupp","network","exception-chaining","cloudflare"],"backgroundTag":null,"analyzedSha":"973504e1770928ed5fb82f43da528f441ad9ddc3","analyzedAt":"2026-08-14T23:45:32.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}