# HG changeset patch # User Ludovic Chabant # Date 1425229622 28800 # Node ID a561fbad0b7ffe7aaf5a524d34499790b823db17 # Parent 12657039c436cc7bd3b612d23b515f55e64165cd logging: If an error doesn't have a message, print its type. diff -r 12657039c436 -r a561fbad0b7f piecrust/chefutil.py --- a/piecrust/chefutil.py Sun Mar 01 09:06:32 2015 -0800 +++ b/piecrust/chefutil.py Sun Mar 01 09:07:02 2015 -0800 @@ -14,7 +14,10 @@ def log_friendly_exception(logger, ex): indent = '' while ex: - logger.error('%s%s' % (indent, str(ex))) + ex_msg = str(ex) + if not ex_msg: + ex_msg = '%s exception was thrown' % type(ex).__name__ + logger.error('%s%s' % (indent, ex_msg)) indent += ' ' ex = ex.__cause__