Skip to content

Commit 64ce4b4

Browse files
committed
Fix review feedback
1 parent 3f8076f commit 64ce4b4

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

readthedocs/doc_builder/environments.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,9 @@ def update_build(self, state=None):
421421
self.build['error'] = str(self.failure)
422422
else:
423423
self.build['error'] = ugettext_noop(
424-
"A failure in our code has occured. "
425-
"Please report this to us with your build id ({}).".format(
426-
self.build['pk']
424+
"There was a problem with Read the Docs while building your documentation. "
425+
"Please report this to us with your build id ({build_id}).".format(
426+
build_id=self.build['pk']
427427
)
428428
)
429429

readthedocs/projects/tasks.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -136,22 +136,19 @@ def run(self, pk, version_pk=None, build_pk=None, record=True,
136136
# **Always** report build status.
137137
# This can still fail if the API Is totally down, but should catch more failures
138138
result = {}
139-
error = 'Unknown error. Please include the build id ({}) in any bug reports.'.format(
140-
build_pk
141-
)
139+
error = _('Unknown error encountered. '
140+
'Please include the build id ({build_id}) in any bug reports.'.format(
141+
build_id=build_pk
142+
))
143+
build_updates = {'state': BUILD_STATE_FINISHED}
144+
build_data = {}
142145
if hasattr(self, 'build'):
143-
self.build['state'] = BUILD_STATE_FINISHED
144-
if failure:
145-
self.build['error'] = error
146-
self.build['success'] = False
147-
result = api_v2.build(build_pk).patch(self.build)
148-
else:
149-
build_updates = {
150-
'state': BUILD_STATE_FINISHED,
151-
'success': False,
152-
'error': error,
153-
}
154-
result = api_v2.build(build_pk).patch(build_updates)
146+
build_data.update(self.build)
147+
if failure:
148+
build_updates['success'] = False
149+
build_updates['error'] = error
150+
build_data.update(build_updates)
151+
result = api_v2.build(build_pk).patch(build_updates)
155152
return result
156153

157154
def run_setup(self, record=True):

0 commit comments

Comments
 (0)