Skip to content
Snippets Groups Projects
Unverified Commit e05d4a9c authored by Awais Jibran's avatar Awais Jibran Committed by GitHub
Browse files

Monitor error in NR when OLX validation fails. (#27381)

parent 2b55959a
No related branches found
No related tags found
No related merge requests found
......@@ -674,9 +674,10 @@ def validate_course_olx(courselike_key, course_dir, status):
course_dir: complete path to the course olx
status: UserTaskStatus object.
"""
is_library = isinstance(courselike_key, LibraryLocator)
olx_is_valid = True
log_prefix = f'Course import {courselike_key}'
validation_failed_mesg = 'CourseOlx validation failed.'
is_library = isinstance(courselike_key, LibraryLocator)
if is_library:
return olx_is_valid
......@@ -698,13 +699,14 @@ def validate_course_olx(courselike_key, course_dir, status):
if not has_errors:
return olx_is_valid
LOGGER.error(f'{log_prefix}: CourseOlx validation failed.')
LOGGER.error(f'{log_prefix}: {validation_failed_mesg}')
log_errors_to_artifact(errorstore, status)
if bypass_olx_failure_enabled():
return olx_is_valid
status.fail(UserErrors.OLX_VALIDATION_FAILED)
monitor_import_failure(courselike_key, status.state, message=validation_failed_mesg)
return False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment