Don't log BuildEnvironmentWarning as error
Turns out we are logging this manually
Closes
import logging
import os
import shutil
+from readthedocs.doc_builder.exceptions import BuildEnvironmentWarning
+from readthedocs.projects.exceptions import RepositoryError
log = logging.getLogger(__name__)
@@ -102,7 +104,13 @@ class BaseVCS:
'shell': False,
})
+ try:
build_cmd = self.environment.run(*cmd, **kwargs)
+ except BuildEnvironmentWarning as e:
+ # Re raise as RepositoryError,
+ # so isn't logged as ERROR.
+ raise RepositoryError(str(e))
+
# Return a tuple to keep compatibility
return (build_cmd.exit_code, build_cmd.output, build_cmd.error)
