Upgrades to error handling, now general try/catch available.

This commit is contained in:
Michael DeHaan
2012-03-13 20:59:05 -04:00
parent 2e1b59a9d2
commit 4ae98ed92d
5 changed files with 92 additions and 52 deletions

View File

@@ -198,7 +198,10 @@ if __name__ == '__main__':
(runner, results) = cli.run(options, args)
except AnsibleError as e:
# Generic handler for ansible specific errors
print e
print "ERROR: %s" % str(e)
sys.exit(1)
except Exception as e2:
print e2.__class__
else:
cli.output(runner, results, options, args)