[PR #6670] fix(sdk): inherit from StarletteHTTPException in Auth exceptions #5204

Open
opened 2026-02-20 17:51:22 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langchain-ai/langgraph/pull/6670

State: open
Merged: No


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.
**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/6670 **State:** open **Merged:** No --- ## 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.
yindo added the pull-request label 2026-02-20 17:51:22 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#5204