Skip to content

Improve exception handling across social_core to include user context #1161

@Anas-hameed

Description

@Anas-hameed

We should improve the AuthAlreadyAssociated exception and other exceptions in social-core to include identifying information such as the user ID or UID. This would significantly help with debugging and tracing issues in production environments.

For instance, in cases like the one raised at:

File: social-core/social_core/pipeline/social_auth.py
Error: social_core.exceptions.AuthAlreadyAssociated: This account is already in use
Code Line: View on GitHub

There is currently no way to determine which user triggered the error. This makes it difficult to diagnose and resolve problems when multiple users are active on the platform.

Recommendation:
Enhance the AuthAlreadyAssociated and other exceptions to include relevant context, such as the user.id, user.username, or social UID, so that developers and maintainers can more easily trace and fix issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions