Skip to content

Conversation

@otaviofbrito
Copy link
Contributor

@otaviofbrito otaviofbrito commented Nov 27, 2025

Title

fix exception for unauthorized routes

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix

Changes

Changed the exception type raised for unauthorized route requests to the proxy.

Before, it was raising a 500 Internal Server Error for unauthorized requests.

Changed it to a proxy exception to log it correctly for the user.

@vercel
Copy link

vercel bot commented Nov 27, 2025

@otaviofbrito is attempting to deploy a commit to the CLERKIEAI Team on Vercel.

A member of the Team first needs to authorize it.

raise Exception(
f"Virtual key is not allowed to call this route. Only allowed to call routes: {valid_token.allowed_routes}. Tried to call route: {route}"
)
raise ProxyException(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might fail a lot of our tests on ci/cd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants