From b7e82c1c0c3370eec1891b3b7dcb08c8946fbd27 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Wed, 23 Oct 1996 15:43:04 +0000 Subject: Raise a more intellegible error in the case of missing keyword args --- Mac/Lib/toolbox/MiniAEFrame.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Mac/Lib/toolbox/MiniAEFrame.py b/Mac/Lib/toolbox/MiniAEFrame.py index d492d27..549b3ee 100644 --- a/Mac/Lib/toolbox/MiniAEFrame.py +++ b/Mac/Lib/toolbox/MiniAEFrame.py @@ -128,9 +128,16 @@ class AEServer: if _parameters.has_key('----'): _object = _parameters['----'] del _parameters['----'] - rv = apply(_function, (_object,), _parameters) + print 'XXX', (_function, (_object,), _parameters) + try: + rv = apply(_function, (_object,), _parameters) + except TypeError, name: + raise TypeError, ('AppleEvent handler misses formal keyword argument', _function, name) else: - rv = apply(_function, (), _parameters) + try: + rv = apply(_function, (), _parameters) + except TypeError, name: + raise TypeError, ('AppleEvent handler misses formal keyword argument', _function, name) if rv == None: aetools.packevent(_reply, {}) -- cgit v0.12