This works for me.
I am creating a new middleware
from social.apps.django_app.middleware import SocialAuthExceptionMiddleware from django.http import HttpResponse from social import exceptions as social_exceptions class MySocialAuthExceptionMiddleware(SocialAuthExceptionMiddleware): def process_exception(self, request, exception): if hasattr(social_exceptions, exception.__class__.__name__): return HttpResponse("catched: %s" % exception) else: raise exception
and add it to settings.py
MIDDLEWARE_CLASSES = ( ... 'path.to.MySocialAuthExceptionMiddleware', )
pvieytes
source share