From: Matthijs Kooijman Date: Sun, 1 Feb 2009 17:58:06 +0000 (+0100) Subject: Make log_error actually return a value. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=4bd2ee34c818b499888d3f0bb52ffbf1eb58580b;p=matthijs%2Fprojects%2Fxerxes.git Make log_error actually return a value. When no error occured, log_error would not pass on the actual value produced by the decorated function. --- diff --git a/tools/misc.py b/tools/misc.py index 1259ab7..ba84f05 100644 --- a/tools/misc.py +++ b/tools/misc.py @@ -22,7 +22,7 @@ prints it to stdout and raises it again. def log_error(func): def show(*args, **kwargs): try: - func(*args, **kwargs) + return func(*args, **kwargs) except Exception, e: import traceback traceback.print_exc()