Skip to content

Commit aa5c8bf

Browse files
committed
fix(docworker): Fix Sentry reporting for document templates
1 parent ccbc5b7 commit aa5c8bf

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/dsw-document-worker/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Fixed filtering Sentry events for document template issues
13+
1014

1115
## [4.16.0]
1216

packages/dsw-document-worker/dsw/document_worker/worker.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,13 @@ def filter_templates(event: sentry.Event, hint: sentry.Hint) -> sentry.Event | N
330330
phase = event.get('tags', {}).get('phase')
331331
if phase in ('render', 'prepare') and template is not None:
332332
template_config = Context.get().app.cfg.templates.get_config(template)
333-
if template_config is not None and not template_config.send_sentry:
333+
send_sentry = template_config.send_sentry if template_config else False
334+
if not send_sentry:
335+
LOG.debug('Skipping Sentry event (template, %s, %s)',
336+
event.get('event_id'), hint)
334337
return None
338+
LOG.debug('Sending Sentry event (template, %s, %s)',
339+
event.get('event_id'), hint)
335340
return event
336341

337342
SentryReporter.filters.append(filter_templates)

0 commit comments

Comments
 (0)