fix: log a single line warning in case of video_transcrip NotFound instead of long detailed exception (#28552)

This commit is contained in:
Mahyar Damavand
2021-09-02 15:44:20 +04:30
committed by GitHub
parent 36283f1a8b
commit 4efa9b5590

View File

@@ -347,8 +347,13 @@ class VideoStudentViewHandlers:
mimetype,
add_attachment_header=False
)
except NotFoundError:
log.exception('[Translation Dispatch] %s', self.location)
except NotFoundError as exc:
edx_video_id = clean_video_id(self.edx_video_id)
log.warning(
'[Translation Dispatch] %s: %s',
self.location,
exc if is_bumper else f'Transcript not found for {edx_video_id}, lang: {self.transcript_language}',
)
response = self.get_static_transcript(request, transcripts)
elif dispatch == 'download':