Skip to content

Commit c5a9acc

Browse files
committed
More error cleanup
1 parent ccf6e47 commit c5a9acc

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

readthedocs/builds/syncers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ def copy(cls, path, target, host, is_file=False, **__):
140140
)
141141
ret = os.system(sync_cmd)
142142
if ret != 0:
143-
log.exception("COPY ERROR to app servers.", ret)
143+
log.error("COPY ERROR to app servers. Return code: ", ret)
144+
log.error("COPY ERROR command run:", sync_cmd)
144145

145146

146147
class Syncer(SettingsOverrideObject):

readthedocs/projects/tasks.py

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -347,28 +347,27 @@ def update_app_instances(self, html=False, localmedia=False, search=False,
347347
'built': True,
348348
})
349349
except HttpClientError:
350-
log.error('Updating version failed, skipping file sync: version=%s',
351-
self.version.pk, exc_info=True)
352-
else:
353-
# Broadcast finalization steps to web application instances
354-
355-
broadcast(
356-
type='app',
357-
task=sync_files,
358-
args=[
359-
self.project.pk,
360-
self.version.pk,
361-
],
362-
kwargs=dict(
363-
hostname=socket.gethostname(),
364-
html=html,
365-
localmedia=localmedia,
366-
search=search,
367-
pdf=pdf,
368-
epub=epub,
369-
),
370-
callback=sync_callback.s(version_pk=self.version.pk, commit=self.build['commit']),
371-
)
350+
log.exception('Updating version failed, skipping file sync: version=%s',
351+
self.version.pk)
352+
353+
# Broadcast finalization steps to web application instances
354+
broadcast(
355+
type='app',
356+
task=sync_files,
357+
args=[
358+
self.project.pk,
359+
self.version.pk,
360+
],
361+
kwargs=dict(
362+
hostname=socket.gethostname(),
363+
html=html,
364+
localmedia=localmedia,
365+
search=search,
366+
pdf=pdf,
367+
epub=epub,
368+
),
369+
callback=sync_callback.s(version_pk=self.version.pk, commit=self.build['commit']),
370+
)
372371

373372
def setup_environment(self):
374373
"""
@@ -566,10 +565,10 @@ def update_imported_docs(version_pk):
566565

567566
try:
568567
api_v2.project(project.pk).sync_versions.post(version_post_data)
569-
except HttpClientError as e:
570-
log.error("Sync Versions Exception: %s", e.content)
571-
except Exception as e:
572-
log.error("Unknown Sync Versions Exception", exc_info=True)
568+
except HttpClientError:
569+
log.exception("Sync Versions Exception")
570+
except Exception:
571+
log.exception("Unknown Sync Versions Exception")
573572
return ret_dict
574573

575574

0 commit comments

Comments
 (0)