Skip to content

Commit

Permalink
fix: add logs for 404 error on gettings xblock
Browse files Browse the repository at this point in the history
  • Loading branch information
NiedielnitsevIvan committed Jun 17, 2024
1 parent 87393cd commit 1072927
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions openedx/features/offline_mode/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from django.contrib.auth import get_user_model
from django.core.files.storage import default_storage
from django.http.response import Http404

from zipfile import ZipFile

Expand Down Expand Up @@ -36,6 +37,8 @@ def generate_offline_content(xblock, html_data):
try:
save_xblock_html(tmp_dir, xblock, html_data)
create_zip_file(tmp_dir, base_path, f'{xblock.location.block_id}.zip')
except Http404:
log.error(f'Block {xblock.location.block_id} for course {xblock.location.course_key} not found.')
finally:
shutil.rmtree(tmp_dir, ignore_errors=True)

Expand Down

0 comments on commit 1072927

Please sign in to comment.