Skip to content

Commit

Permalink
fix: update loging message
Browse files Browse the repository at this point in the history
update loging message copy by adding exception message for debugging

SONIC-794
  • Loading branch information
mubbsharanwar committed Nov 26, 2024
1 parent d33974a commit 799feb3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion commerce_coordinator/apps/lms/clients.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""
API clients for LMS app.
"""
import json as Json

from celery.utils.log import get_task_logger
from django.conf import settings
from requests.exceptions import RequestException
Expand Down Expand Up @@ -118,8 +120,10 @@ def post(self, url, json, line_item_state_payload, logging_obj, timeout=None):
sender=self.__class__,
**fulfill_line_item_state_payload
)
error_message = Json.loads(exc.response.text).get('message')
logger.info(
f"Unsuccessful fulfillment for user: {logging_obj['user']} with details: "
f"Unsuccessful fulfillment for user: {logging_obj['user']} "
f"due to {error_message} with details: "
f"[lms user id: {logging_obj['lms_user_id']}, order id: {logging_obj['order_id']}, "
f"course id: {logging_obj['course_id']}, message_id: {logging_obj['message_id']}, "
f"celery_task_id: {logging_obj['celery_task_id']}]"
Expand Down

0 comments on commit 799feb3

Please sign in to comment.