From 501ca5c41f0adcef2e72236c40845fd31057ecbe Mon Sep 17 00:00:00 2001 From: Florian Tschopp Date: Tue, 26 Mar 2019 14:17:33 +0100 Subject: [PATCH] added some exception handling for io (#529) --- catkin_tools/execution/io.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/catkin_tools/execution/io.py b/catkin_tools/execution/io.py index 26db2439..4c5a4f75 100644 --- a/catkin_tools/execution/io.py +++ b/catkin_tools/execution/io.py @@ -107,16 +107,23 @@ def close(self): logfile.write(self.stderr_buffer) def get_interleaved_log(self): - """Get decoded interleaved log.""" - return self._decode(self.interleaved_buffer) - + """get decoded interleaved log.""" + try: + return self._decode(self.interleaved_buffer) + except: + return "interleaved_log: some output cannot be displayed.\n" def get_stdout_log(self): - """Get decoded stdout log.""" - return self._decode(self.stdout_buffer) - + """get decoded stdout log.""" + try: + return self._decode(self.stdout_buffer) + except: + return "stdout_log: some output cannot be displayed.\n" def get_stderr_log(self): - """Get decoded stderr log.""" - return self._decode(self.stderr_buffer) + """get decoded stderr log.""" + try: + return self._decode(self.stderr_buffer) + except: + return "stderr_log: some output cannot be displayed.\n" def _encode(self, data): """Encode a Python str into bytes.