Skip to content

Commit

Permalink
[Processing] Yet another fix for error message encoding errors. Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
borysiasty committed Jan 23, 2017
1 parent 538b7c9 commit 1ede526
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion python/plugins/processing/core/GeoAlgorithm.py
Expand Up @@ -213,8 +213,16 @@ def execute(self, progress=None, model=None):
lines = [self.tr('Uncaught error while executing algorithm')]
lines.append(traceback.format_exc())
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR, lines)
try:
message = unicode(e)
except Exception:
# Encoding the error message failed. Try with the 'replace' mode.
try:
message = unicode(e.message, 'utf-8', 'replace')
except Exception:
message = self.tr('Unknown error')
raise GeoAlgorithmExecutionException(
unicode(e.message, errors='replace') + self.tr(u'\nSee log for more details'))
message + self.tr(' \nSee log for more details'), lines, e)

def _checkParameterValuesBeforeExecuting(self):
for param in self.parameters:
Expand Down

0 comments on commit 1ede526

Please sign in to comment.