{"record":{"id":"655c6ff14b704c74","repo":"BerriAI/litellm","slug":"statuscode-in-response-statuscode-in-response","errorCode":null,"errorMessage":"statusCode in response: {statusCode_in_response}, errorMsg: {errorMsg}","messagePattern":"statusCode in response: (.+?), errorMsg: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/zscaler_ai_guard.py","lineNumber":354,"sourceCode":"                        \"action\": \"ALLOW\",\n                        \"zscaler_ai_guard_response\": json_response,\n                        \"direction\": direction,\n                    }\n                else:\n                    verbose_proxy_logger.error(\n                        \"Action field in response is %s, expecting 'ALLOW', 'BLOCK' or 'DETECT'\", guardrail_result\n                    )\n                    user_facing_error = self._create_user_facing_error(\n                        f\"Action field in response is {guardrail_result}, expecting 'ALLOW', 'BLOCK' or 'DETECT'\"\n                    )\n                    raise HTTPException(status_code=500, detail=user_facing_error)\n            else:\n                errorMsg: Final = json_response.get(\"errorMsg\", None)\n                verbose_proxy_logger.error(\"statusCode in response: %s, errorMsg: %s\", statusCode_in_response, errorMsg)\n                user_facing_error = self._create_user_facing_error(\n                    f\"statusCode in response: {statusCode_in_response}, errorMsg: {errorMsg}\"\n                )\n                raise HTTPException(status_code=500, detail=user_facing_error)\n        else:\n            verbose_proxy_logger.error(\"Zscaler AI Guard status_code - %s\", response.status_code)\n            user_facing_error = self._create_user_facing_error(f\"Response status code: {response.status_code}\")\n            raise HTTPException(status_code=response.status_code, detail=user_facing_error)\n\n    async def make_zscaler_ai_guard_api_call(\n        self, zscaler_ai_guard_url, api_key, policy_id, direction, content, **kwargs\n    ):\n        \"\"\"\n        Makes an API call to the Zscaler AI Guard service and handles retries, errors, and response parsing.\n        \"\"\"\n\n        extra_headers: Final = self._prepare_headers(api_key, **kwargs)\n\n        data: Final = {\n            \"direction\": direction,\n            \"content\": content,\n        }","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/zscaler_ai_guard.py#L336-L372","documentation":"Error \"statusCode in response: {statusCode_in_response}, errorMsg: {errorMsg}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/zscaler_ai_guard.py:354 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read errorMsg from the Zscaler response for the server-side cause.","Verify the request payload matches the Zscaler AI Guard API schema."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}