From fcea4eb3f63218e77cc594ff4322dc40d72fd632 Mon Sep 17 00:00:00 2001 From: Vratko Polak Date: Mon, 4 Jun 2018 15:33:10 +0200 Subject: CSIT-1110: Print NameError to reduce confusion See https://gerrit.fd.io/r/12724 for an example mistake which also can cause NameError. Change-Id: I65c74744c027800a95014f3be48d0f522a10ce2b Signed-off-by: Vratko Polak --- resources/tools/presentation/generator_plots.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'resources/tools/presentation/generator_plots.py') diff --git a/resources/tools/presentation/generator_plots.py b/resources/tools/presentation/generator_plots.py index 6faf4c3935..d89d68f98a 100644 --- a/resources/tools/presentation/generator_plots.py +++ b/resources/tools/presentation/generator_plots.py @@ -39,9 +39,9 @@ def generate_plots(spec, data): try: logging.info(" Plot nr {0}:".format(index + 1)) eval(plot["algorithm"])(plot, data) - except NameError: - logging.error("The algorithm '{0}' is not defined.". - format(plot["algorithm"])) + except NameError as err: + logging.error("Probably algorithm '{alg}' is not defined: {err}". + format(alg=plot["algorithm"], err=repr(err)) logging.info("Done.") -- cgit 1.2.3-korg