@@ -63,12 +63,12 @@ def __init__(self, transaction_style="route_name"):
63
63
@staticmethod
64
64
def setup_once ():
65
65
# type: () -> None
66
- from pyramid . router import Router
66
+ from pyramid import router
67
67
from pyramid .request import Request
68
68
69
- old_handle_request = Router . handle_request
69
+ old_call_view = router . _call_view
70
70
71
- def sentry_patched_handle_request ( self , request , * args , ** kwargs ):
71
+ def sentry_patched_call_view ( registry , request , * args , ** kwargs ):
72
72
# type: (Any, Request, *Any, **Any) -> Response
73
73
hub = Hub .current
74
74
integration = hub .get_integration (PyramidIntegration )
@@ -81,15 +81,15 @@ def sentry_patched_handle_request(self, request, *args, **kwargs):
81
81
elif integration .transaction_style == "route_pattern" :
82
82
scope .transaction = request .matched_route .pattern
83
83
except Exception :
84
- pass
84
+ raise
85
85
86
86
scope .add_event_processor (
87
87
_make_event_processor (weakref .ref (request ), integration )
88
88
)
89
89
90
- return old_handle_request (self , request , * args , ** kwargs )
90
+ return old_call_view (self , request , * args , ** kwargs )
91
91
92
- Router . handle_request = sentry_patched_handle_request
92
+ router . _call_view = sentry_patched_call_view
93
93
94
94
if hasattr (Request , "invoke_exception_view" ):
95
95
old_invoke_exception_view = Request .invoke_exception_view
0 commit comments