mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
sentry: Stacks are returned most-recent last.
Per [1], the sentry API returns frames sorted from oldest to newest. As such, matching against the first filename that matches is most likely not the right frame. Match against the last frame with the guilty filename. [1] https://develop.sentry.dev/sdk/event-payloads/stacktrace/
This commit is contained in:
committed by
Steve Howell
parent
47fe7b7d13
commit
0db311ddad
@@ -44,17 +44,14 @@ Traceback:
|
||||
|
||||
Traceback:
|
||||
```javascript
|
||||
const Sentry = require('@sentry/node');
|
||||
|
||||
Sentry.init({
|
||||
dsn: 'https://redacted.ingest.sentry.io/5216640',
|
||||
});
|
||||
|
||||
---> Sentry.withScope(function(scope) {
|
||||
Sentry.withScope(function(scope) {
|
||||
scope.addEventProcessor(function(event, hint) {
|
||||
return event;
|
||||
});
|
||||
Sentry.captureException(new Error('Sample error from node.'));
|
||||
---> Sentry.captureException(new Error('Sample error from node.'));
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ def handle_event_payload(event: Dict[str, Any]) -> Tuple[str, str]:
|
||||
|
||||
if stacktrace:
|
||||
exception_frame = None
|
||||
for frame in stacktrace["frames"]:
|
||||
for frame in reversed(stacktrace["frames"]):
|
||||
if frame["filename"] == filename:
|
||||
exception_frame = frame
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user