def fail_gracefully(f):
 @functools.wraps(f)
 def wrapper(*args, **kw):
  try:
   return f(*args, **kw)
  except Exception as e:
   LOG.debug(e, exc_info=True)
   LOG.critical(e)
   sys.exit(1)
 return wrapper

def fail_gracefully ( f ) : @ functools . wraps ( f ) def wrapper ( * args , ** kw ) : try : return f ( * args , ** kw ) except Exception as e : LOG . debug ( e , exc_info = True ) LOG . critical ( e ) sys . exit ( 1 ) return wrapper
log exceptions and aborts .