mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 04:33:34 +08:00
Slightly more verbose error reporting
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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__()
|
||||
|
||||
Reference in New Issue
Block a user