From 33c6e4013874878f05eec593d69e8afdeaae212b Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Wed, 23 Jan 2008 18:51:33 -0500 Subject: Working on async error handling, lots more to do... (If it hits no exceptions, returns are right, it's the partial error case to deal with next...) --- func/utils.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'func/utils.py') diff --git a/func/utils.py b/func/utils.py index 4149885..140b761 100755 --- a/func/utils.py +++ b/func/utils.py @@ -14,7 +14,9 @@ import os import string import sys import traceback +import xmlrpclib +REMOTE_CANARY = "***REMOTE_ERROR***" # this is kind of handy, so keep it around for now # but we really need to fix out server side logging and error @@ -44,3 +46,42 @@ def daemonize(pidfile=None): if pidfile is not None: open(pidfile, "w").write(str(pid)) sys.exit(0) + +def remove_exceptions(results): + """ + Used by forkbomb/jobthing to avoid storing exceptions in database + because you know those don't serialize so well :) + # FIXME: this needs cleanup + """ + + if results is None: + print "DEBUG: A" + return REMOTE_CANARY + + if str(results).startswith("