From 98b2597c300ee8e308488701e777c6b48327a555 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Tue, 4 Mar 2014 23:13:39 +0400 Subject: [PATCH] Slightly more verbose error reporting --- libuavcan/dsdl_compiler/dsdlc.py | 4 ++-- pyuavcan/pyuavcan/dsdl/common.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libuavcan/dsdl_compiler/dsdlc.py b/libuavcan/dsdl_compiler/dsdlc.py index 03ed19cf74..8cec28e638 100755 --- a/libuavcan/dsdl_compiler/dsdlc.py +++ b/libuavcan/dsdl_compiler/dsdlc.py @@ -48,8 +48,8 @@ def run_parser(source_dir, search_dirs): try: types = dsdl.parse_namespace(source_dir, search_dirs) except dsdl.DsdlException as ex: - errtext = str(ex) # TODO: gcc-style formatting - die(errtext) + logging.info('Parser failure', exc_info=True) + die(str(ex)) return types def run_generator(types, dest_dir): diff --git a/pyuavcan/pyuavcan/dsdl/common.py b/pyuavcan/pyuavcan/dsdl/common.py index 23b785ac6d..ac96e5356d 100644 --- a/pyuavcan/pyuavcan/dsdl/common.py +++ b/pyuavcan/pyuavcan/dsdl/common.py @@ -12,7 +12,7 @@ class DsdlException(Exception): def __str__(self): if self.file and self.line: - return '%s:%s: %s' % (pretty_filename(self.file), self.line, super().__str__()) + return '%s:%d: %s' % (pretty_filename(self.file), self.line, super().__str__()) if self.file: return '%s: %s' % (pretty_filename(self.file), super().__str__()) return super().__str__()