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 class MagicError(Exception): pass
@ -34,7 +33,7 @@ class Spellbook:
except MagicError as e: except MagicError as e:
return e.message return e.message
except Exception: except Exception:
return PythonUtil.describeException(backTrace=1) return describeException(backTrace=1)
finally: finally:
self.currentInvoker = None self.currentInvoker = None
self.currentTarget = None self.currentTarget = None

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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