Merge lp:~mvo/software-center/lp921799 into lp:software-center

Proposed by Michael Vogt
Status: Merged
Merge reported by: Gary Lasker
Merged at revision: not available
Proposed branch: lp:~mvo/software-center/lp921799
Merge into: lp:software-center
Diff against target: 16 lines (+5/-1)
1 file modified
softwarecenter/db/application.py (+5/-1)
To merge this branch: bzr merge lp:~mvo/software-center/lp921799
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+104659@code.launchpad.net

Description of the change

This branch fixes crash LP: #921799 that is pretty common according to errors.ubuntu.com

To post a comment you must log in.
Revision history for this message
Gary Lasker (gary-lasker) wrote :

This will definitely fix the crash. I wonder, do you have an idea about why we might be be getting these JSON errors? In any chase, this will take care of the crash.

Thanks mvo!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/db/application.py'
2--- softwarecenter/db/application.py 2012-04-30 22:27:29 +0000
3+++ softwarecenter/db/application.py 2012-05-04 01:16:20 +0000
4@@ -673,7 +673,11 @@
5 # ignore read errors, most likely transient
6 return
7 if content is not None:
8- content = json.loads(content)
9+ try:
10+ content = json.loads(content)
11+ except ValueError as e:
12+ LOG.error("can not decode: '%s' (%s)" % (content, e))
13+ content = None
14
15 if isinstance(content, dict):
16 # a list of screenshots as listsed online

Subscribers

People subscribed via source and target branches