author | ca |
Thu, 25 Jul 2002 17:51:40 +0200 | |
changeset 6668 | f2489cb96530 |
parent 6667 | cd760a230e58 |
child 6669 | 992abad6f5aa |
permissions | -rw-r--r-- |
5976 | 1 |
"{ Package: 'stx:libbasic' }" |
2 |
||
3 |
Error subclass:#MessageNotUnderstood |
|
4 |
instanceVariableNames:'' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
6210
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
7 |
category:'Kernel-Exceptions-Errors' |
5976 | 8 |
! |
9 |
||
6210
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
10 |
!MessageNotUnderstood class methodsFor:'documentation'! |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
11 |
|
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
12 |
documentation |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
13 |
" |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
14 |
raised when a message is sent to an object, which is not understood |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
15 |
by the receiver, and the message was not handled by a class specific |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
16 |
doesNotUnderstand: handler. |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
17 |
" |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
18 |
! ! |
5976 | 19 |
|
20 |
!MessageNotUnderstood class methodsFor:'queries'! |
|
21 |
||
22 |
mayProceed |
|
23 |
"Return true, because messageNotUnderstood is proceedable (with nil)." |
|
24 |
||
25 |
^ true |
|
26 |
! ! |
|
27 |
||
6667 | 28 |
!MessageNotUnderstood class methodsFor:'save evaluation'! |
29 |
||
30 |
ignoreNotUnderstoodOf:aSelector in:aBlock |
|
31 |
"evaluate aBlock; if a messageNotUnderstood occurs, |
|
32 |
for which the message was aSelector, ignore the error |
|
33 |
and return. |
|
34 |
Other selector errors lead into the debugger. |
|
35 |
If no error occurs, return the blocks value" |
|
36 |
||
37 |
^ self handle:[:ex | |
|
38 |
ex parameter selector == aSelector ifFalse:[ |
|
39 |
ex reject |
|
40 |
] |
|
41 |
] do:aBlock. |
|
6668 | 42 |
! |
43 |
||
44 |
ignoreNotUnderstoodOfAny:aCollectionOfSelectors in:aBlock |
|
45 |
"evaluate aBlock; if a messageNotUnderstood occurs, |
|
46 |
for which the message was any in aCollectionOfSelectors, ignore the error |
|
47 |
and return. |
|
48 |
Other selector errors lead into the debugger. |
|
49 |
If no error occurs, return the blocks value" |
|
50 |
||
51 |
^ self handle:[:ex | |
|
52 |
(aCollectionOfSelectors includesIdentical:ex parameter selector) ifFalse:[ |
|
53 |
ex reject |
|
54 |
] |
|
55 |
] do:aBlock. |
|
6667 | 56 |
! ! |
57 |
||
5982 | 58 |
!MessageNotUnderstood methodsFor:'accessing'! |
59 |
||
60 |
message |
|
61 |
^ parameter |
|
62 |
||
63 |
" |
|
64 |
[ |
|
65 |
123 perform:#foo |
|
66 |
] on:MessageNotUnderstood do:[:ex | |
|
67 |
Transcript show:'message object: '; showCR:ex message storeString. |
|
68 |
Transcript show:'receiver: '; showCR:ex receiver storeString. |
|
69 |
Transcript show:'selector: '; showCR:ex message selector storeString. |
|
70 |
Transcript show:'arguments: '; showCR:ex message arguments storeString. |
|
71 |
] |
|
72 |
" |
|
73 |
! |
|
74 |
||
75 |
receiver |
|
76 |
^ originator |
|
77 |
||
78 |
" |
|
79 |
[ |
|
80 |
123 perform:#foo |
|
81 |
] on:MessageNotUnderstood do:[:ex | |
|
82 |
Transcript showCR:ex receiver |
|
83 |
] |
|
84 |
" |
|
6668 | 85 |
! |
86 |
||
87 |
selector |
|
88 |
^ parameter selector |
|
89 |
||
90 |
" |
|
91 |
[ |
|
92 |
123 perform:#foo |
|
93 |
] on:MessageNotUnderstood do:[:ex | |
|
94 |
Transcript show:'selector: '; showCR:ex selector storeString. |
|
95 |
] |
|
96 |
" |
|
5982 | 97 |
! ! |
98 |
||
5976 | 99 |
!MessageNotUnderstood class methodsFor:'documentation'! |
100 |
||
101 |
version |
|
6668 | 102 |
^ '$Header: /cvs/stx/stx/libbasic/MessageNotUnderstood.st,v 1.5 2002-07-25 15:51:40 ca Exp $' |
5976 | 103 |
! ! |