Skip to content

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

Open
vichu3d-dev wants to merge 4 commits intolangchain-ai:mainfrom
vichu3d-dev:main
Open

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

Conversation

@vichu3d-dev
Copy link

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.

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.

1 participant