getsentry / getsentry/sentry

Explicit Exception chaining focuses on outer Exception

Open
#32,358 10 comments 10 reactions 0 assignees View on GitHub
Improvement Waiting for: Product Owner
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
1d 5h
Merged PRs (30d)
624

Description

If I explicitly chain 2 exceptions:
```python
try:
if not my_var:
raise Exception('Incorrect data')

if not parsed_data:
raise Exception('Parsing failed')

except Exception as e:
raise Exception('Failed to convert file') from e
```

The outer exception (in this case: 'Failed to convert file') gets the focus in the Sentry issue (e.g. it decides the title). This is imo incorrect behavior since if issues are grouped by stack trace, you will now have 2 issues with the same title but with different underlying exceptions.

I think the title of the issue should be decided from the innermost exception.
This might be related to getsentry/sentry-python#243.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.