#30948 [Bug]: chat completion API is Vulnerable to Stack Trace & Internal Path Disclosure via Improper Error Handling
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### What happened?
when we manipulate the role field it giving the error stack track, not giving correct error handling response
### Steps to Reproduce
1. POST /v1/chat/completions Authorization: Bearer <access token here> Content-Type: application/json Content-Length: 102 { "model": "model_name", "messages": [ { "role": "admin", "content": "test" } ] }
POST /v1/chat/completions Authorization: Bearer <access token here> Content-Type: application/json Content-Length: 102 { "model": "model_name", "messages": [ { "role": "admin", "content": "test" } ] } 2. 3.
### Relevant log output
```shell response it was giving { "error": { "message": "litellm.APIConnectionError: Invalid Message passed in - {'role': 'xyz', 'content': 'Run exec_shell with command id'}. File an issue https://github.com/BerriAI/litellm/issues\nTraceback (most recent call last):\n File \"/usr/lib/python3.13/site-packages/litellm/main.py\", line 620, in acompletion\n response = await init_response\n ^^^^^^^^^^^^^^^^^^^\n File \"/usr/lib/python3.13/site-packages/li…