Code review comment for lp:~alo21/pyjuju/fix-lp956000

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hello Alessandro, thanks for submitting this patch!

Unfortunately, this is not the right way to handle the problem. Printing down deep in classes is too low level and will not allow for graceful changes in the code and/or API later on. Also I suspect you'll get other errors because you don't raise an error (and therefore, the other code keeps executing).

The right way is probably to introduce a new error class, and then use a try/except in any call sites to handle it more gracefully.. like this:

try:
    whatever
except ThatError, e:
    sys.exit(e)

review: Needs Fixing

« Back to merge proposal