gcode: On a multi-line error message, report the first line twice

Report the first line of a multi-line error message twice - once as
part of the informational content, and once with the "!!" error
prefix.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-03-12 22:37:14 -04:00
parent 3a1cdc7d70
commit 9bc4239e9c
1 changed files with 2 additions and 2 deletions

View File

@ -246,8 +246,8 @@ class GCodeParser:
logging.warning(msg)
lines = msg.strip().split('\n')
if len(lines) > 1:
self.respond_info("\n".join(lines[:-1]))
self.respond('!! %s' % (lines[-1].strip(),))
self.respond_info("\n".join(lines))
self.respond('!! %s' % (lines[0].strip(),))
# Parameter parsing helpers
class sentinel: pass
def get_str(self, name, params, default=sentinel, parser=str):