@@ -126,21 +126,21 @@ def test_transaction_with_error(
126126 sentry_init , crashing_app , capture_events , DictionaryContaining # noqa:N803
127127):
128128 def dogpark (environ , start_response ):
129- raise Exception ("Fetch aborted. The ball was not returned." )
129+ raise ValueError ("Fetch aborted. The ball was not returned." )
130130
131131 sentry_init (send_default_pii = True , traces_sample_rate = 1.0 )
132132 app = SentryWsgiMiddleware (dogpark )
133133 client = Client (app )
134134 events = capture_events ()
135135
136- with pytest .raises (Exception ):
136+ with pytest .raises (ValueError ):
137137 client .get ("http://dogs.are.great/sit/stay/rollover/" )
138138
139139 error_event , envelope = events
140140
141141 assert error_event ["transaction" ] == "generic WSGI request"
142142 assert error_event ["contexts" ]["trace" ]["op" ] == "http.server"
143- assert error_event ["exception" ]["values" ][0 ]["type" ] == "Exception "
143+ assert error_event ["exception" ]["values" ][0 ]["type" ] == "ValueError "
144144 assert error_event ["exception" ]["values" ][0 ]["mechanism" ]["type" ] == "wsgi"
145145 assert error_event ["exception" ]["values" ][0 ]["mechanism" ]["handled" ] is False
146146 assert (
@@ -189,14 +189,14 @@ def test_has_trace_if_performance_enabled(
189189):
190190 def dogpark (environ , start_response ):
191191 capture_message ("Attempting to fetch the ball" )
192- raise Exception ("Fetch aborted. The ball was not returned." )
192+ raise ValueError ("Fetch aborted. The ball was not returned." )
193193
194194 sentry_init (traces_sample_rate = 1.0 )
195195 app = SentryWsgiMiddleware (dogpark )
196196 client = Client (app )
197197 events = capture_events ()
198198
199- with pytest .raises (Exception ):
199+ with pytest .raises (ValueError ):
200200 client .get ("http://dogs.are.great/sit/stay/rollover/" )
201201
202202 msg_event , error_event , transaction_event = events
@@ -223,14 +223,14 @@ def test_has_trace_if_performance_disabled(
223223):
224224 def dogpark (environ , start_response ):
225225 capture_message ("Attempting to fetch the ball" )
226- raise Exception ("Fetch aborted. The ball was not returned." )
226+ raise ValueError ("Fetch aborted. The ball was not returned." )
227227
228228 sentry_init ()
229229 app = SentryWsgiMiddleware (dogpark )
230230 client = Client (app )
231231 events = capture_events ()
232232
233- with pytest .raises (Exception ):
233+ with pytest .raises (ValueError ):
234234 client .get ("http://dogs.are.great/sit/stay/rollover/" )
235235
236236 msg_event , error_event = events
@@ -248,7 +248,7 @@ def test_trace_from_headers_if_performance_enabled(
248248):
249249 def dogpark (environ , start_response ):
250250 capture_message ("Attempting to fetch the ball" )
251- raise Exception ("Fetch aborted. The ball was not returned." )
251+ raise ValueError ("Fetch aborted. The ball was not returned." )
252252
253253 sentry_init (traces_sample_rate = 1.0 )
254254 app = SentryWsgiMiddleware (dogpark )
@@ -258,7 +258,7 @@ def dogpark(environ, start_response):
258258 trace_id = "582b43a4192642f0b136d5159a501701"
259259 sentry_trace_header = "{}-{}-{}" .format (trace_id , "6e8f22c393e68f19" , 1 )
260260
261- with pytest .raises (Exception ):
261+ with pytest .raises (ValueError ):
262262 client .get (
263263 "http://dogs.are.great/sit/stay/rollover/" ,
264264 headers = {"sentry-trace" : sentry_trace_header },
@@ -286,7 +286,7 @@ def test_trace_from_headers_if_performance_disabled(
286286):
287287 def dogpark (environ , start_response ):
288288 capture_message ("Attempting to fetch the ball" )
289- raise Exception ("Fetch aborted. The ball was not returned." )
289+ raise ValueError ("Fetch aborted. The ball was not returned." )
290290
291291 sentry_init ()
292292 app = SentryWsgiMiddleware (dogpark )
@@ -296,7 +296,7 @@ def dogpark(environ, start_response):
296296 trace_id = "582b43a4192642f0b136d5159a501701"
297297 sentry_trace_header = "{}-{}-{}" .format (trace_id , "6e8f22c393e68f19" , 1 )
298298
299- with pytest .raises (Exception ):
299+ with pytest .raises (ValueError ):
300300 client .get (
301301 "http://dogs.are.great/sit/stay/rollover/" ,
302302 headers = {"sentry-trace" : sentry_trace_header },
0 commit comments