You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There may be many reasons when ThirdPartyFailure raises, eg. generaly it's used in providers when response code from provider is not 200.
Well, eg.
Looking at velruse source i can see no way to catch such en exceptions in my own code, so i can not display human readable message and show it to user - instead ugly 500 appears.
Shouldn't be some way added to catch ThirdPartyFailure eg, just the way velruse.AuthenticationDenied view is set up?
The text was updated successfully, but these errors were encountered:
The reasonable solution is to return ThirdPartyFailure (and other exceptions that inherit from VelruseException) than raise it.
Than we could register view in our application which will handle the errors the same way we handle AuthenticationComplete and AuthenticationDenied. Eg.:
@view_config(context='velruse.exceptions.VelruseException',renderer='app:templates/social_login_error.html',)deflogin_error_view(request):
# do something with it, eg. redirect to home and flash messageerror=request.context.messagerequest.session.flash({'type': 'danger', 'messages': [error, ]})
log.warning(request.context)
returnHTTPFound(location=request.route_url('home'))
There may be many reasons when ThirdPartyFailure raises, eg. generaly it's used in providers when response code from provider is not 200.
Well, eg.
Looking at velruse source i can see no way to catch such en exceptions in my own code, so i can not display human readable message and show it to user - instead ugly 500 appears.
Shouldn't be some way added to catch ThirdPartyFailure eg, just the way velruse.AuthenticationDenied view is set up?
The text was updated successfully, but these errors were encountered: