Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
6ab6b72c
Commit
6ab6b72c
authored
Jun 03, 2014
by
Greg Price
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3941 from edx/gprice/handle-invalid-json
Improve handling of bad JSON from comments service
parents
a415b507
dc234285
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletions
+9
-1
lms/lib/comment_client/utils.py
+9
-1
No files found.
lms/lib/comment_client/utils.py
View file @
6ab6b72c
...
...
@@ -104,7 +104,15 @@ def perform_request(method, url, data_or_params=None, raw=False,
if
raw
:
return
response
.
text
else
:
data
=
response
.
json
()
try
:
data
=
response
.
json
()
except
ValueError
:
raise
CommentClientError
(
u"Comments service returned invalid JSON for request {request_id}; first 100 characters: '{content}'"
.
format
(
request_id
=
request_id
,
content
=
response
.
text
[:
100
]
)
)
if
paged_results
:
dog_stats_api
.
histogram
(
'comment_client.request.paged.result_count'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment