Skip to content

Commit 033e3ad

Browse files
ref(bottle): Delete never-reached code (#3605)
The `prepared_callback` should never raise an `HTTPResponse` exception because `prepared_callback` is already decorated by Bottle using a `@route` decorator (or a decorator for the specific HTTP methods, e.g. `@get`). This decorated function never raises `HTTPResponse`, because the `@route` wrapper [captures any `HTTPResponse` exception and converts it into the return value](https://github.com/bottlepy/bottle/blob/cb36a7d83dc560e81dd131a365ee09db2f756a52/bottle.py#L2006-L2009). So, we do not need this code and should delete it.
1 parent e2aa6a5 commit 033e3ad

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

sentry_sdk/integrations/bottle.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
Bottle,
3131
Route,
3232
request as bottle_request,
33-
HTTPResponse,
3433
__version__ as BOTTLE_VERSION,
3534
)
3635
except ImportError:
@@ -114,8 +113,6 @@ def wrapped_callback(*args, **kwargs):
114113

115114
try:
116115
res = prepared_callback(*args, **kwargs)
117-
except HTTPResponse:
118-
raise
119116
except Exception as exception:
120117
event, hint = event_from_exception(
121118
exception,

0 commit comments

Comments
 (0)