Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Error message modified to get more error details
Browse files Browse the repository at this point in the history
  • Loading branch information
shafqatfarhan authored and wajeeha-khalid committed Sep 26, 2018
1 parent b99aeca commit 06b1d90
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lms/lib/comment_client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,14 @@ def perform_request(method, url, data_or_params=None, raw=False,
try:
data = response.json()
except ValueError:
#This error message is modified only for debugging purpose and will be revert back in future.
raise CommentClientError(
u"Invalid JSON response for request {request_id}; first 100 characters: '{content}'".format(
u"Invalid JSON response for request {request_id} with status code: {status_code}"
u" and response length: {length}; first 100 characters: '{content}'".format(
request_id=request_id,
content=response.text[:100]
content=response.text[:100],
length=len(response.text),
status_code=response.status_code
)
)
if paged_results:
Expand Down

0 comments on commit 06b1d90

Please sign in to comment.