Fix an issue w/ describeException not working.

This commit is contained in:
John Cote 2015-07-08 08:06:14 -04:00
parent da7ba5ce89
commit d0c0054e89
7 changed files with 9 additions and 14 deletions

View file

@ -1,4 +1,3 @@
from toontown.toonbase import PythonUtil
class MagicError(Exception): pass
@ -34,7 +33,7 @@ class Spellbook:
except MagicError as e:
return e.message
except Exception:
return PythonUtil.describeException(backTrace=1)
return describeException(backTrace=1)
finally:
self.currentInvoker = None
self.currentTarget = None

View file

@ -2,7 +2,6 @@ from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObject
from direct.distributed.ClockDelta import *
from direct.showbase import PythonUtil
from toontown.toonbase import PythonUtil as TTPythonUtil
from direct.showbase.DirectObject import *
from direct.task import Task
from panda3d.core import *
@ -122,7 +121,7 @@ class TimeManager(DistributedObject.DistributedObject):
self.sendUpdate('setDisconnectReason', [disconnectCode])
def setExceptionInfo(self):
info = TTPythonUtil.describeException()
info = describeException()
self.notify.info('Client exception: %s' % info)
self.sendUpdate('setExceptionInfo', [info])
self.cr.flush()

View file

@ -18,8 +18,6 @@ sys.path.append(
)
)
from toontown.toonbase import PythonUtil
import argparse
parser = argparse.ArgumentParser()
@ -65,6 +63,6 @@ try:
except SystemExit:
raise
except Exception:
info = PythonUtil.describeException()
info = describeException()
simbase.air.writeServerEvent('ai-exception', avId=simbase.air.getAvatarIdFromSender(), accId=simbase.air.getAccountIdFromSender(), exception=info)
raise

View file

@ -1,5 +1,4 @@
from direct.directnotify.DirectNotifyGlobal import directNotify
from toontown.toonbase import PythonUtil
class ToontownRPCDispatcher:
@ -48,4 +47,4 @@ class ToontownRPCDispatcher:
else:
request.result(method(*params))
except:
request.error(-32603, PythonUtil.describeException())
request.error(-32603, describeException())

View file

@ -189,6 +189,5 @@ if autoRun:
except SystemExit:
raise
except:
from toontown.toonbase import PythonUtil
print PythonUtil.describeException()
print describeException()
raise

View file

@ -96,3 +96,6 @@ def describeException(backTrace = 4):
description += "%s: %s" % (exceptionName, extraInfo)
return description
import __builtin__
__builtin__.describeException = describeException

View file

@ -17,8 +17,6 @@ sys.path.append(
)
)
from toontown.toonbase import PythonUtil
import argparse
parser = argparse.ArgumentParser()
@ -67,6 +65,6 @@ try:
except SystemExit:
raise
except Exception:
info = PythonUtil.describeException()
info = describeException()
simbase.air.writeServerEvent('uberdog-exception', simbase.air.getAvatarIdFromSender(), simbase.air.getAccountIdFromSender(), info)
raise