Skip to content

fix(sdk): inherit from StarletteHTTPException in Auth exceptions#6670

Open
Vishnukumar Annamalai (vichu3d-dev) wants to merge 4 commits intolangchain-ai:mainfrom
vichu3d-dev:main
Open

fix(sdk): inherit from StarletteHTTPException in Auth exceptions#6670
Vishnukumar Annamalai (vichu3d-dev) wants to merge 4 commits intolangchain-ai:mainfrom
vichu3d-dev:main

Conversation

@vichu3d-dev
Copy link
Copy Markdown

Description

Fixes issue #6552 where Auth.exceptions.HTTPException status codes were being lost/swallowed by the API layer because the exception type was not recognized as a standard HTTP exception.

This change updates langgraph_sdk.auth.exceptions.HTTPException to inherit from starlette.exceptions.HTTPException when starlette is available in the environment. This ensures correct exception handling semantics while maintaining backward compatibility.

Changes

  • Modified libs/sdk-py/langgraph_sdk/auth/exceptions.py to conditionally inherit from StarletteHTTPException.

verification

  • Verified locally with a reproduction script mocking the API layer behavior.
  • Confirmed inheritance relationships.

@mdrxy Mason Daugherty (mdrxy) added the bypass-issue-check Maintainer override: skip issue-link enforcement label Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bypass-issue-check Maintainer override: skip issue-link enforcement external

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants