Skip to content

Commit

Permalink
chore: handle null response in exception
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstankiewicz committed Oct 31, 2024
1 parent 43f76b8 commit 734a90f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion enterprise_access/apps/api_client/lms_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ def get_default_enterprise_enrollment_intentions_learner_status(self, enterprise
dict: Dictionary representation of the JSON response from the API
"""
query_params = {'enterprise_customer_uuid': enterprise_customer_uuid}
response = None
try:
response = self.get(
self.default_enterprise_enrollment_intentions_learner_status_endpoint,
Expand All @@ -431,6 +432,6 @@ def get_default_enterprise_enrollment_intentions_learner_status(self, enterprise
logger.exception(
f"Failed to fetch default enterprise enrollment intentions for enterprise customer "
f"{enterprise_customer_uuid} and learner {self.request_user.lms_user_id}: {exc} "
f"Response content: {response.content}"
f"Response content: {response.content if response else None}"
)
raise

0 comments on commit 734a90f

Please sign in to comment.