Skip to content

Commit cadcc80

Browse files
committed
Handling Exceptions better when building tests
Previously, when building tests with test.py, if an exception occurred, the error message would be masked by the function 'build_tests'. This commit handles NotSupportedExceptions and ToolExceptions, but lets all other Exceptions propigate up to the caller function. In most cases, this is the CLI scripts, which will print a traceback. This will allow us to better debug the python tools if errors occur.
1 parent b481da4 commit cadcc80

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tools/test_api.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,14 +2106,14 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name,
21062106
verbose=verbose,
21072107
app_config=app_config)
21082108

2109-
except Exception, e:
2110-
if not isinstance(e, NotSupportedException):
2111-
result = False
2112-
2113-
if continue_on_build_fail:
2114-
continue
2115-
else:
2116-
break
2109+
except NotSupportedException:
2110+
pass
2111+
except ToolException:
2112+
result = False
2113+
if continue_on_build_fail:
2114+
continue
2115+
else:
2116+
break
21172117

21182118
# If a clean build was carried out last time, disable it for the next build.
21192119
# Otherwise the previously built test will be deleted.

0 commit comments

Comments
 (0)