Skip to content

Commit a82aba9

Browse files
authoredApr 7, 2017
Merge pull request #4338 from timlinux/processing-fixes
[processing] Added more error handling for cases when processing help causes an error
2 parents 2adccb9 + 2308b07 commit a82aba9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎python/plugins/processing/gui/GetScriptsAndModels.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,13 @@ def setHelp(self, reply, item):
267267
html = self.tr('<h2>No detailed description available for this script</h2>')
268268
else:
269269
content = bytes(reply.readAll()).decode('utf8')
270-
descriptions = json.loads(content)
270+
try:
271+
descriptions = json.loads(content)
272+
except json.decoder.JSONDecodeError:
273+
html = self.tr('<h2>JSON Decoding Error - could not load help</h2>')
274+
except Exception:
275+
html = self.tr('<h2>Unspecified Error - could not load help</h2>')
276+
271277
html = '<h2>%s</h2>' % item.name
272278
html += self.tr('<p><b>Description:</b> {0}</p>').format(getDescription(ALG_DESC, descriptions))
273279
html += self.tr('<p><b>Created by:</b> {0}').format(getDescription(ALG_CREATOR, descriptions))

0 commit comments

Comments
 (0)