Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow the commit_veto to handle squashed exceptions #65

Merged

Conversation

mmerickel
Copy link
Member

@mmerickel mmerickel commented Jul 1, 2017

Basically this allows the commit_veto to decide to commit a transaction even if the request contains a squashed exception.

This change is bw-incompatible for anyone using a commit_veto as the veto will now be consulted for some requests that previously (all the way back to pyramid_tm 1.x) were simply aborted.

I think this is a nice balance - pyramid_tm still has no hook in which you can specify that you want to commit an unhandled exception but I feel like that's alright. The advantage of this particular PR is that HTTPFound etc are currently squashed by Pyramid and that fact combined with this change is that the veto hook could allow those to be committed. I'd even consider making the default_commit_veto the default for pyramid_tm and pushing a 3.0. I'd only change the veto if it was configured to abort on 4xx/5xx and request.exception was not None (currently it aborts without checking request.exception.

fixes #64

@mmerickel
Copy link
Member Author

I decided to just ship this as-is and not worry about changing the commit veto. Anyone can do that if they choose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants