File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -917,7 +917,7 @@ def add_breadcrumb(
917917 if crumb .get ("type" ) is None :
918918 crumb ["type" ] = "default"
919919
920- new_crumb = crumb
920+ new_crumb = None
921921 if before_breadcrumb is not None :
922922 with capture_internal_exceptions ():
923923 new_crumb = before_breadcrumb (crumb , hint )
Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ def do_this():
214214
215215@pytest .mark .tests_internal_exceptions
216216def test_option_before_breadcrumb_exception (sentry_init , capture_events ):
217- """Exceptions in before_breadcrumb are contained ."""
217+ """Breadcrumb is dropped if before_breadcrumb raises an exception ."""
218218
219219 def before_breadcrumb (crumb , hint ):
220220 1 / 0
@@ -234,10 +234,7 @@ def do_this():
234234 (event ,) = events
235235
236236 assert event ["exception" ]["values" ][0 ]["type" ] == "ValueError"
237- (crumb ,) = event ["breadcrumbs" ]["values" ]
238- assert "timestamp" in crumb
239- assert crumb ["message" ] == "Hello"
240- assert crumb ["type" ] == "default"
237+ assert event ["breadcrumbs" ]["values" ] == []
241238
242239
243240def test_breadcrumb_arguments (sentry_init , capture_events ):
You can’t perform that action at this time.
0 commit comments