Permalink
Browse files

Handle failed slot delegation differently in rudel-impersonator

* rudel-util.el (rudel-impersonator::slot-missing): if something goes
  wrong when accessing the slot of the target object signal the error
  from here
  • Loading branch information...
1 parent 40dedf7 commit e455b32e0da36a1396ee820cede1c650d0be363d @scymtym scymtym committed Jul 10, 2010
Showing with 11 additions and 6 deletions.
  1. +11 −6 rudel-util.el
View
@@ -121,12 +121,17 @@ the slots of some other object as if they were their own slots."
slot-name operation &optional new-value)
"Look up SLOT-NAME in the state machine associated to THIS."
(let ((target (slot-value this (oref this impersonation-target-slot))))
- (case operation
- (oref
- (slot-value target slot-name))
-
- (oset
- (set-slot-value target slot-name new-value))))
+ (condition-case error
+ (case operation
+ (oref
+ (slot-value target slot-name))
+
+ (oset
+ (set-slot-value target slot-name new-value)))
+ (invalid-slot-name
+ (if (next-method-p)
+ (call-next-method)
+ (apply #'signal error)))))
)

0 comments on commit e455b32

Please sign in to comment.