Improve exception handling across rpc interface

Modified Files:
 	rpc.py
This commit is contained in:
Kurt B. Kaiser 2002-08-24 23:57:17 +00:00
parent e87ab3fefe
commit a552e3a0c9
1 changed files with 4 additions and 1 deletions

View File

@ -208,7 +208,7 @@ def decoderesponse(self, response):
if how == "EXCEPTION":
mod, name, args, tb = what
self.traceback = tb
if mod:
if mod: # not string exception
try:
__import__(mod)
module = sys.modules[mod]
@ -220,7 +220,10 @@ def decoderesponse(self, response):
except AttributeError:
pass
else:
# instantiate a built-in exception object and raise it
raise getattr(__import__(mod), name)(*args)
name = mod + "." + name
# do the best we can:
raise name, args
if how == "ERROR":
raise RuntimeError, what