+
+"""
+Decarator that catches any exception raised by the decorated function,
+prints it to stdout and raises it again.
+"""
+def log_error(func):
+ def show(*args, **kwargs):
+ try:
+ func(*args, **kwargs)
+ except Exception, e:
+ import traceback
+ traceback.print_exc()
+ raise e
+ return show