author | Claus Gittinger <cg@exept.de> |
Fri, 05 Mar 2004 18:28:27 +0100 | |
changeset 8081 | b468050174a9 |
parent 7586 | 63e4900c8931 |
child 8501 | 8e114640aa5c |
permissions | -rw-r--r-- |
7586 | 1 |
" |
2 |
COPYRIGHT (c) 2001 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
5976 | 13 |
"{ Package: 'stx:libbasic' }" |
14 |
||
15 |
Error subclass:#MessageNotUnderstood |
|
16 |
instanceVariableNames:'' |
|
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
6210
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
19 |
category:'Kernel-Exceptions-Errors' |
5976 | 20 |
! |
21 |
||
6210
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
22 |
!MessageNotUnderstood class methodsFor:'documentation'! |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
23 |
|
7586 | 24 |
copyright |
25 |
" |
|
26 |
COPYRIGHT (c) 2001 by eXept Software AG |
|
27 |
All Rights Reserved |
|
28 |
||
29 |
This software is furnished under a license and may be used |
|
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
37 |
||
6210
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
38 |
documentation |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
39 |
" |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
40 |
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
|
41 |
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
|
42 |
doesNotUnderstand: handler. |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
43 |
" |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5982
diff
changeset
|
44 |
! ! |
5976 | 45 |
|
46 |
!MessageNotUnderstood class methodsFor:'queries'! |
|
47 |
||
48 |
mayProceed |
|
49 |
"Return true, because messageNotUnderstood is proceedable (with nil)." |
|
50 |
||
51 |
^ true |
|
52 |
! ! |
|
53 |
||
6667 | 54 |
!MessageNotUnderstood class methodsFor:'save evaluation'! |
55 |
||
56 |
ignoreNotUnderstoodOf:aSelector in:aBlock |
|
57 |
"evaluate aBlock; if a messageNotUnderstood occurs, |
|
58 |
for which the message was aSelector, ignore the error |
|
59 |
and return. |
|
60 |
Other selector errors lead into the debugger. |
|
61 |
If no error occurs, return the blocks value" |
|
62 |
||
63 |
^ self handle:[:ex | |
|
6669 | 64 |
ex selector == aSelector ifFalse:[ |
6667 | 65 |
ex reject |
66 |
] |
|
67 |
] do:aBlock. |
|
6668 | 68 |
! |
69 |
||
70 |
ignoreNotUnderstoodOfAny:aCollectionOfSelectors in:aBlock |
|
71 |
"evaluate aBlock; if a messageNotUnderstood occurs, |
|
72 |
for which the message was any in aCollectionOfSelectors, ignore the error |
|
73 |
and return. |
|
74 |
Other selector errors lead into the debugger. |
|
75 |
If no error occurs, return the blocks value" |
|
76 |
||
77 |
^ self handle:[:ex | |
|
6669 | 78 |
(aCollectionOfSelectors includesIdentical:ex selector) ifFalse:[ |
6668 | 79 |
ex reject |
80 |
] |
|
81 |
] do:aBlock. |
|
6667 | 82 |
! ! |
83 |
||
5982 | 84 |
!MessageNotUnderstood methodsFor:'accessing'! |
85 |
||
86 |
message |
|
87 |
^ parameter |
|
88 |
||
89 |
" |
|
90 |
[ |
|
91 |
123 perform:#foo |
|
92 |
] on:MessageNotUnderstood do:[:ex | |
|
93 |
Transcript show:'message object: '; showCR:ex message storeString. |
|
94 |
Transcript show:'receiver: '; showCR:ex receiver storeString. |
|
95 |
Transcript show:'selector: '; showCR:ex message selector storeString. |
|
96 |
Transcript show:'arguments: '; showCR:ex message arguments storeString. |
|
97 |
] |
|
98 |
" |
|
99 |
! |
|
100 |
||
101 |
receiver |
|
102 |
^ originator |
|
103 |
||
104 |
" |
|
105 |
[ |
|
106 |
123 perform:#foo |
|
107 |
] on:MessageNotUnderstood do:[:ex | |
|
108 |
Transcript showCR:ex receiver |
|
109 |
] |
|
110 |
" |
|
6668 | 111 |
! |
112 |
||
113 |
selector |
|
114 |
^ parameter selector |
|
115 |
||
116 |
" |
|
117 |
[ |
|
118 |
123 perform:#foo |
|
119 |
] on:MessageNotUnderstood do:[:ex | |
|
120 |
Transcript show:'selector: '; showCR:ex selector storeString. |
|
121 |
] |
|
122 |
" |
|
5982 | 123 |
! ! |
124 |
||
5976 | 125 |
!MessageNotUnderstood class methodsFor:'documentation'! |
126 |
||
127 |
version |
|
7586 | 128 |
^ '$Header: /cvs/stx/stx/libbasic/MessageNotUnderstood.st,v 1.7 2003-08-29 19:15:14 cg Exp $' |
5976 | 129 |
! ! |