social-core icon indicating copy to clipboard operation
social-core copied to clipboard

Improve exception handling across social_core to include user context

Open Anas-hameed opened this issue 10 months ago • 1 comments

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.

Anas-hameed avatar May 22 '25 17:05 Anas-hameed

Patches are welcome!

nijel avatar May 22 '25 18:05 nijel