Engine - use of python built-in exceptions in PL processing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Murano |
Fix Released
|
Medium
|
Stan Lagun |
Bug Description
EDIT: may be duplicate of https:/
Within the PL processing (particular executor.py, expressions.py) there's use of Python built-in exceptions (SyntaxError, ValueError, TypeError). These exceptions are for use in tightly-defined scenarios, so while their use makes sense looking at their names, it causes confusion when debugging because developers (well, me, anyway) are used to seeing them in a different context.
I suggest adding to dsl/exceptions.py equivalents (DSLSyntaxError etc), and at the same time providing more diagnostic information, since the stacktraces are often not useful because they're tens of levels deep. As an example from executor.py L175, instead of:
if name not in arguments_scheme:
raise TypeError()
Use:
if name not in arguments_scheme:
raise DSLTypeError("'%s' is not in the recognized arguments (%s)" % (name, argument_scheme))
The calling code can turn this error into something else if necessary but preserve the information.
In addition, exception handling blocks that don't log a message should have a comment explaining how they are handling the error if it isn't obvious.
Changed in murano: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
milestone: | none → juno-1 |
description: | updated |
Changed in murano: | |
milestone: | juno-1 → juno-2 |
Changed in murano: | |
milestone: | juno-2 → juno-3 |
Changed in murano: | |
milestone: | juno-3 → juno-rc1 |
Changed in murano: | |
milestone: | juno-rc1 → none |
Changed in murano: | |
status: | In Progress → Fix Committed |
milestone: | none → kilo-2 |
Changed in murano: | |
status: | Fix Committed → Fix Released |
Changed in murano: | |
milestone: | kilo-2 → 2015.1.0 |
Fix proposed to branch: master /review. openstack. org/104508
Review: https:/