Skip to content

Commit

Permalink
Merge pull request #4041 from borysiasty/release-2_18
Browse files Browse the repository at this point in the history
[Processing] Yet another fix for error message encoding errors. Fixes #16102
  • Loading branch information
borysiasty committed Jan 23, 2017
2 parents 1746b32 + 6071b40 commit 685e4a2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/plugins/processing/core/GeoAlgorithm.py
Expand Up @@ -215,8 +215,13 @@ def execute(self, progress=SilentProgress(), 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 UnicodeDecodeError:
# Try with the 'replace' mode (requires e.message instead of e!)
message = unicode(e.message, 'utf-8', 'replace')
raise GeoAlgorithmExecutionException(
unicode(e.message, errors='replace') + self.tr('\nSee log for more details'), lines, e)
message + self.tr(' \nSee log for more details'), lines, e)

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

0 comments on commit 685e4a2

Please sign in to comment.