Removed try/except TypeError around calling the ae handler function, it masksprogrammer errors and obfuscates the stacktrace. Suggested by Tattoo Mabonzo K.
This commit is contained in:
parent
136815d939
commit
62e3843ca7
|
@ -146,15 +146,13 @@ class AEServer:
|
||||||
if _parameters.has_key('----'):
|
if _parameters.has_key('----'):
|
||||||
_object = _parameters['----']
|
_object = _parameters['----']
|
||||||
del _parameters['----']
|
del _parameters['----']
|
||||||
try:
|
# The try/except that used to be here can mask programmer errors.
|
||||||
rv = apply(_function, (_object,), _parameters)
|
# Let the program crash, the programmer can always add a **args
|
||||||
except TypeError, name:
|
# to the formal parameter list.
|
||||||
raise TypeError, ('AppleEvent handler misses formal keyword argument', _function, name)
|
rv = apply(_function, (_object,), _parameters)
|
||||||
else:
|
else:
|
||||||
try:
|
#Same try/except comment as above
|
||||||
rv = apply(_function, (), _parameters)
|
rv = apply(_function, (), _parameters)
|
||||||
except TypeError, name:
|
|
||||||
raise TypeError, ('AppleEvent handler misses formal keyword argument', _function, name)
|
|
||||||
|
|
||||||
if rv == None:
|
if rv == None:
|
||||||
aetools.packevent(_reply, {})
|
aetools.packevent(_reply, {})
|
||||||
|
|
Loading…
Reference in New Issue