Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENT-7725] - Add try catch block for enhanced debugging #1918

Merged
merged 3 commits into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions integrated_channels/degreed2/exporters/learner_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,22 @@ def get_learner_data_records(
f'percent_grade={percent_grade}, degreed_completed_timestamp={degreed_completed_timestamp}'
f'completed_date={completed_date}, course_completed={course_completed}'
))
if enterprise_enrollment.enterprise_customer_user.get_remote_id(
self.enterprise_configuration.idp_id
) is not None:
LOGGER.info(generate_formatted_log(
try:
remote_id = enterprise_enrollment.enterprise_customer_user.get_remote_id(
self.enterprise_configuration.idp_id
)
except Exception as e: # pylint: disable=broad-except
LOGGER.error(generate_formatted_log(
self.enterprise_configuration.channel_code(),
enterprise_enrollment.enterprise_customer_user.enterprise_customer.uuid,
enterprise_enrollment.enterprise_customer_user.user_id,
enterprise_enrollment.course_id,
'[Degreed2Client] - Found remote id:'
f'percent_grade={percent_grade}, degreed_completed_timestamp={degreed_completed_timestamp}'
f'completed_date={completed_date}, course_completed={course_completed}'
f'course_id={get_course_id_for_enrollment(enterprise_enrollment)}'
'[Degreed2Client] get_learner_data_records failed, possibly due to an invalid customer configuration. '
f'Error: {e}'
))
return None

if remote_id is not None:
Degreed2LearnerDataTransmissionAudit = apps.get_model(
'degreed2',
'Degreed2LearnerDataTransmissionAudit'
Expand Down