allow the commit_veto to handle squashed exceptions #65
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thedefault_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 andrequest.exception
was notNone
(currently it aborts without checkingrequest.exception
.fixes #64