Skip to content

Commit 0e3df50

Browse files
authored
Merge pull request #6851 from readthedocs/humitos/build-warnings
Add more exceptions as WARNING log level
2 parents c969b18 + 2a7f17e commit 0e3df50

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

readthedocs/doc_builder/environments.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
from readthedocs.core.utils import slugify
2727
from readthedocs.projects.constants import LOG_TEMPLATE
2828
from readthedocs.projects.models import Feature
29+
from readthedocs.projects.exceptions import (
30+
RepositoryError,
31+
ProjectConfigurationError,
32+
)
2933

3034
from .constants import (
3135
DOCKER_HOSTNAME_MAX_LEN,
@@ -528,15 +532,18 @@ class BuildEnvironment(BaseEnvironment):
528532
successful
529533
"""
530534

531-
# Exceptions considered ERROR from a Build perspective but as a WARNING for
532-
# the application itself. These exception are logged as warning and not sent
533-
# to Sentry.
535+
# These exceptions are considered ERROR from a Build perspective (the build
536+
# failed and can continue) but as a WARNING for the application itself (RTD
537+
# code didn't failed). These exception are logged as ``WARNING`` and they
538+
# are not sent to Sentry.
534539
WARNING_EXCEPTIONS = (
535540
VersionLockedError,
536541
ProjectBuildsSkippedError,
537542
YAMLParseError,
538543
BuildTimeoutError,
539544
MkDocsYAMLParseError,
545+
RepositoryError,
546+
ProjectConfigurationError,
540547
)
541548

542549
def __init__(

readthedocs/projects/tasks.py

+4-16
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,10 @@ def get_rtd_env_vars(self):
307307
return env
308308

309309

310-
@app.task(max_retries=5, default_retry_delay=7 * 60)
310+
@app.task(
311+
max_retries=5,
312+
default_retry_delay=7 * 60,
313+
)
311314
def sync_repository_task(version_pk):
312315
"""Celery task to trigger VCS version sync."""
313316
try:
@@ -394,25 +397,10 @@ def run(self, version_pk): # pylint: disable=arguments-differ
394397
return False
395398

396399

397-
# Exceptions under ``throws`` argument are considered ERROR from a Build
398-
# perspective (the build failed and can continue) but as a WARNING for the
399-
# application itself (RTD code didn't failed). These exception are logged as
400-
# ``INFO`` and they are not sent to Sentry.
401400
@app.task(
402401
bind=True,
403402
max_retries=5,
404403
default_retry_delay=7 * 60,
405-
throws=(
406-
VersionLockedError,
407-
ProjectBuildsSkippedError,
408-
YAMLParseError,
409-
BuildTimeoutError,
410-
BuildEnvironmentWarning,
411-
RepositoryError,
412-
ProjectConfigurationError,
413-
ProjectBuildsSkippedError,
414-
MkDocsYAMLParseError,
415-
),
416404
)
417405
def update_docs_task(self, version_pk, *args, **kwargs):
418406
try:

0 commit comments

Comments
 (0)