Skip to content

Commit e9c5829

Browse files
committed
Sentry: ignore logging known exceptions
By reading https://docs.sentry.io/clients/python/integrations/#additional-settings it seems that we should be able to ignore known exceptions to be sent to Sentry. Note that we have this setting already defined at https://github.com/readthedocs/readthedocs.org/blob/b5908b0fc65cb02fc840b23eeb4218b3115b6590/readthedocs/settings/base.py#L453 However, we need to add these known exceptions to https://github.com/readthedocs/readthedocs.org/blob/b5908b0fc65cb02fc840b23eeb4218b3115b6590/readthedocs/projects/tasks/builds.py#L224-L229 This commit adds the known exceptions to be ignored by Celery and not sent to Sentry either.
1 parent b5908b0 commit e9c5829

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

readthedocs/projects/tasks/builds.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,21 @@ class UpdateDocsTask(SyncRepositoryMixin, Task):
220220
max_retries = 5 # 5 per normal builds, 25 per concurrency limited
221221
default_retry_delay = 7 * 60
222222

223-
# Expected exceptions that will be logged as info only and not retried
223+
# Expected exceptions that will be logged as info only and not retried.
224+
# These exceptions are not sent to Sentry either because we are using
225+
# ``SENTRY_CELERY_IGNORE_EXPECTED=True``.
226+
#
227+
# All exceptions generated by a user miss-configuration should be listed
228+
# here. Actually, every subclass of ``BuildUserError``.
224229
throws = (
225230
DuplicatedBuildError,
226231
ProjectBuildsSkippedError,
227232
ConfigError,
228233
YAMLParseError,
234+
BuildUserError,
235+
RepositoryError,
236+
MkDocsYAMLParseError,
237+
ProjectConfigurationError,
229238
)
230239

231240
acks_late = True

0 commit comments

Comments
 (0)