author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 12 Jul 2010 17:20:36 +0100 | |
branch | jv |
changeset 17780 | b6e42c92eba0 |
parent 17772 | 6e0b3c06c364 |
child 17797 | 71451ae83564 |
permissions | -rw-r--r-- |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
8617 | 3 |
All Rights Reserved |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
4 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
5 |
This software is furnished under a license and may be used |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
6 |
only in accordance with the terms of that license and with the |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
7 |
inclusion of the above copyright notice. This software may not |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
8 |
be provided or otherwise made available to, or used by, any |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
9 |
other person. No title to or ownership of the software is |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
10 |
hereby transferred. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
11 |
" |
5348
8220f8db1cc1
added #signalWith: for ANSI compatibility.
Claus Gittinger <cg@exept.de>
parents:
5295
diff
changeset
|
12 |
"{ Package: 'stx:libbasic' }" |
8220f8db1cc1
added #signalWith: for ANSI compatibility.
Claus Gittinger <cg@exept.de>
parents:
5295
diff
changeset
|
13 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
14 |
Object subclass:#GenericException |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
15 |
instanceVariableNames:'signal parameter messageText suspendedContext raiseContext |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
16 |
handlerContext rejected originator proceedable' |
8677 | 17 |
classVariableNames:'StrictRaising' |
18 |
poolDictionaries:'' |
|
19 |
category:'Kernel-Exceptions' |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
20 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
21 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
22 |
GenericException class instanceVariableNames:'NotifierString' |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
23 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
24 |
" |
5259 | 25 |
No other class instance variables are inherited by this class. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
26 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
27 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
28 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
29 |
!GenericException class methodsFor:'documentation'! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
30 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
31 |
copyright |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
32 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
33 |
COPYRIGHT (c) 1993 by Claus Gittinger |
8617 | 34 |
All Rights Reserved |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
35 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
36 |
This software is furnished under a license and may be used |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
37 |
only in accordance with the terms of that license and with the |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
38 |
inclusion of the above copyright notice. This software may not |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
39 |
be provided or otherwise made available to, or used by, any |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
40 |
other person. No title to or ownership of the software is |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
41 |
hereby transferred. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
42 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
43 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
44 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
45 |
documentation |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
46 |
" |
8617 | 47 |
Note: |
48 |
The instance based Signal framework is being replaced by |
|
49 |
class based exceptions. |
|
50 |
I.e. what used to be instances of Signal/QuerySignal is beeing |
|
51 |
rewritten into subclasses of Exception/Error/Query and Warning. |
|
52 |
Although the functionality is basically unchanged, the new |
|
53 |
class based exceptions are easier to instanciate (no need for |
|
54 |
creation in a classes initialize method), easier to use (no real |
|
55 |
need for SIgnal-constant accessors) and allow for easier parameter |
|
56 |
passing (not only a single parameter, but allows for individual |
|
57 |
exception subclasses to add additional state). |
|
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
58 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
59 |
GenericException and its subclasses implement the same protocol as Signal. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
60 |
So class based exceptions may be implemented as subclasses of GenericException. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
61 |
|
7631
df27883aa7db
Undo previous change form cg (on his request!).
Stefan Vogel <sv@exept.de>
parents:
7597
diff
changeset
|
62 |
Normally all exceptions are subclasses of Exception. Exceptions, that are |
df27883aa7db
Undo previous change form cg (on his request!).
Stefan Vogel <sv@exept.de>
parents:
7597
diff
changeset
|
63 |
used for debugging or that are signalling errors in the exception system itself |
df27883aa7db
Undo previous change form cg (on his request!).
Stefan Vogel <sv@exept.de>
parents:
7597
diff
changeset
|
64 |
are direct subclasses of GenericException. |
df27883aa7db
Undo previous change form cg (on his request!).
Stefan Vogel <sv@exept.de>
parents:
7597
diff
changeset
|
65 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
66 |
Instances of Exception are passed to a Signal handling block as argument. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
67 |
The handler block may perform various actions by sending corresponding messages |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
68 |
to the exception object. The following actions are possible: |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
69 |
|
8617 | 70 |
reject - don't handle this signal; |
71 |
another handler will be searched for, |
|
72 |
upper in the calling hierarchy |
|
73 |
||
74 |
proceed - return from the Signal>>raise, with nil as value |
|
75 |
||
76 |
proceedWith:val - same, but return val from Signal>>raise |
|
77 |
||
78 |
return - return from the Signal>>handle:do:, with nil as value |
|
79 |
||
80 |
returnWith:val - same, but return val from Signal>>handle:do: |
|
81 |
(this is also the handlers default, |
|
82 |
if it falls through; taking the handlerBlocks value |
|
83 |
as return value) |
|
84 |
||
85 |
restart - restart the Signal>>handle:do:, after repairing |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
86 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
87 |
Via the Exception object, the handler can also query the state of execution: |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
88 |
where the Signal was raised, where the handler is, the signal which caused |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
89 |
the error and the messageText passed when the signal was raised. Also, an optional |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
90 |
parameter can be passed - the use is signal specific. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
91 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
92 |
[instance variables:] |
8617 | 93 |
signal <Signal> the signal which caused the exception |
94 |
||
95 |
parameter <Object> a parameter (if any) which was passed when raising |
|
96 |
the signal (only if raised with #raiseWith:aParameter) |
|
97 |
||
98 |
messageText <String> an messageText |
|
99 |
(usually the signals own messageText, but sometimes |
|
100 |
changed explicitely in #raiseWith:errorString:) |
|
101 |
||
102 |
suspendedContext <Context> the context in which the raise occured |
|
103 |
||
104 |
handlerContext <Context> the context of the handler (if any) |
|
105 |
||
106 |
In case of an unhandled signal raise, Exceptions EmergenyHandler will be evaluated. |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
107 |
The default emergeny handler will enter the debugger. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
108 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
109 |
For applications, which do not want Debuggers to come up, other handlers are |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
110 |
possible. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
111 |
For example, to get the typical C++ behavior, use: |
8617 | 112 |
Exception emergencyHandler:[:ex | Smalltalk exitWithCoreDump] |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
113 |
|
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
114 |
|
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
115 |
Raising: |
8617 | 116 |
two different raising messages are to be used, |
117 |
depending on whether the exception is proceedable or not |
|
118 |
||
119 |
For some stupid reason, someone decided that the raise-code checks if |
|
120 |
the raising messages matches to what the signal thinks is its proceedability. |
|
121 |
(i.e. not only do both the sender and the signal itself specify proceedability, |
|
122 |
this is checked by the raise code and a warning is generated if there is a mismatch) |
|
123 |
This used to be even worse (WrongProceedabilityError), but we relaxed this to |
|
124 |
a message sent to stderr. |
|
125 |
||
126 |
That means, that PROCEEDABLE signals must be raised with: |
|
127 |
raiseRequest |
|
128 |
and NON-PROCEEDABLE signals must be raised with: |
|
129 |
raise |
|
130 |
||
131 |
If you dont know/care as a raiser, you can use |
|
132 |
raiseSignal |
|
133 |
which checks for proceedability and sends the appropriate message. |
|
134 |
(sigh) |
|
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
135 |
|
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
136 |
all of the 3 messages above come in various flavours: |
8617 | 137 |
raiseXXX - do not pass any additional parameter; |
138 |
default messageText |
|
139 |
||
140 |
raiseXXXWith: - pass additional parameter; |
|
141 |
default messageText |
|
142 |
||
143 |
raiseXXXErrorString: - do not pass any additional parameter; |
|
144 |
given errorString |
|
145 |
||
146 |
raiseXXXWith:errorString: |
|
147 |
- pass any additional parameter; |
|
148 |
AND given errorString |
|
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
149 |
|
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
150 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
151 |
[see also:] |
8617 | 152 |
Signal SignalSet QuerySignal |
153 |
Context Block |
|
154 |
Object DebugView |
|
155 |
(``Exception handling and signals'': programming/exceptions.html) |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
156 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
157 |
[author:] |
8617 | 158 |
Claus Gittinger |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
159 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
160 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
161 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
162 |
examples |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
163 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
164 |
Examples on Exception-raising & handling are found in the doc/coding |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
165 |
section (CodingExamples). |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
166 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
167 |
The emergencyHandler stuff is very useful, to prevent endUser applications |
4554 | 168 |
from entering the debugger. See the examples in NoHandlerError. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
169 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
170 |
! ! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
171 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
172 |
!GenericException class methodsFor:'initialization'! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
173 |
|
8617 | 174 |
initialize |
4519
fb4904d6787b
Implement RecursiveExceptionError. as class based exception.
Stefan Vogel <sv@exept.de>
parents:
4517
diff
changeset
|
175 |
|
fb4904d6787b
Implement RecursiveExceptionError. as class based exception.
Stefan Vogel <sv@exept.de>
parents:
4517
diff
changeset
|
176 |
NotifierString := 'unknown exception'. |
6598 | 177 |
StrictRaising := false. "set to true to check weather a signal may be raised proceedable" |
4519
fb4904d6787b
Implement RecursiveExceptionError. as class based exception.
Stefan Vogel <sv@exept.de>
parents:
4517
diff
changeset
|
178 |
|
fb4904d6787b
Implement RecursiveExceptionError. as class based exception.
Stefan Vogel <sv@exept.de>
parents:
4517
diff
changeset
|
179 |
"Modified: / 4.8.1999 / 09:06:26 / stefan" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
180 |
! ! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
181 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
182 |
!GenericException class methodsFor:'instance creation'! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
183 |
|
8487 | 184 |
new |
185 |
"{ Pragma: +inlineNew }" |
|
186 |
||
187 |
^ self basicNew setSignal:self. |
|
188 |
||
189 |
"Modified: / 23.7.1999 / 13:53:12 / stefan" |
|
190 |
"Created: / 24.7.1999 / 13:21:13 / stefan" |
|
191 |
! |
|
192 |
||
193 |
newException |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
194 |
"{ Pragma: +inlineNew }" |
8487 | 195 |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
196 |
^ self basicNew setSignal:self. |
8487 | 197 |
|
198 |
"Created: / 23.7.1999 / 13:45:49 / stefan" |
|
199 |
"Modified: / 24.7.1999 / 13:21:25 / stefan" |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
200 |
! ! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
201 |
|
17761
b0e5971141bc
Added Lookup and BuiltinLookup classes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17736
diff
changeset
|
202 |
|
7296 | 203 |
!GenericException class methodsFor:'Compatibility-Dolphin'! |
6246 | 204 |
|
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
205 |
signal:messageText |
6250 | 206 |
"raise a signal proceedable or nonproceedable (whichever is right). |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
207 |
The argument is used as messageText." |
6250 | 208 |
|
209 |
<context: #return> |
|
210 |
||
8617 | 211 |
^ (self newException |
212 |
suspendedContext:thisContext sender |
|
213 |
errorString:messageText) |
|
214 |
raiseSignal. |
|
6246 | 215 |
! ! |
216 |
||
10189 | 217 |
!GenericException class methodsFor:'Compatibility-Squeak'! |
218 |
||
219 |
signal |
|
220 |
"raise a signal proceedable or nonproceedable (whichever is right). |
|
221 |
The argument is used as messageText." |
|
222 |
||
223 |
^ self raiseSignal |
|
224 |
||
225 |
"Created: / 20-11-2006 / 14:00:09 / cg" |
|
226 |
! ! |
|
227 |
||
4562 | 228 |
!GenericException class methodsFor:'accessing'! |
229 |
||
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
230 |
errorString |
4562 | 231 |
"#errorString is deprecated, use description instead" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
232 |
|
6859
5ef85865e8db
Print exception description with #printOn:
Stefan Vogel <sv@exept.de>
parents:
6630
diff
changeset
|
233 |
<resource:#obsolete> |
5ef85865e8db
Print exception description with #printOn:
Stefan Vogel <sv@exept.de>
parents:
6630
diff
changeset
|
234 |
|
4562 | 235 |
^ self description |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
236 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
237 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
238 |
handlerBlock |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
239 |
"Compatibility with Signal. Class based exeptions do not have a handler |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
240 |
block. They redefine the #action method instead" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
241 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
242 |
^ nil |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
243 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
244 |
"Created: / 23.7.1999 / 14:43:18 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
245 |
"Modified: / 24.7.1999 / 20:52:10 / stefan" |
8677 | 246 |
! |
247 |
||
248 |
notifierString:aString |
|
249 |
||
250 |
NotifierString := aString |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
251 |
! ! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
252 |
|
8677 | 253 |
!GenericException class methodsFor:'backward compatibility'! |
254 |
||
255 |
abortingEmergencyHandler |
|
256 |
"WARNING: this method belongs to NoHandlerError, and has been moved there" |
|
257 |
<resource: #obsolete> |
|
258 |
||
259 |
^ NoHandlerError abortingEmergencyHandler |
|
260 |
! |
|
261 |
||
262 |
dumpingEmergencyHandler |
|
263 |
"WARNING: this method belongs to NoHandlerError, and has been moved there" |
|
264 |
<resource: #obsolete> |
|
265 |
||
266 |
^ NoHandlerError dumpingEmergencyHandler |
|
267 |
! |
|
4562 | 268 |
|
269 |
emergencyHandler |
|
8677 | 270 |
"WARNING: this method belongs to NoHandlerError, and has been moved there" |
271 |
<resource: #obsolete> |
|
4562 | 272 |
|
273 |
^ NoHandlerError emergencyHandler. |
|
274 |
! |
|
275 |
||
276 |
emergencyHandler:aOneArgBlock |
|
8677 | 277 |
"WARNING: this method belongs to NoHandlerError, and has been moved there" |
278 |
<resource: #obsolete> |
|
279 |
||
280 |
^ NoHandlerError emergencyHandler:aOneArgBlock |
|
281 |
! |
|
282 |
||
283 |
mailingEmergencyHandler |
|
284 |
"WARNING: this method belongs to NoHandlerError, and has been moved there" |
|
285 |
<resource: #obsolete> |
|
286 |
||
287 |
^ NoHandlerError mailingEmergencyHandler |
|
288 |
! |
|
289 |
||
290 |
notifyingEmergencyHandler |
|
291 |
"WARNING: this method belongs to NoHandlerError, and has been moved there" |
|
292 |
<resource: #obsolete> |
|
293 |
||
294 |
^ NoHandlerError notifyingEmergencyHandler |
|
295 |
! |
|
4562 | 296 |
|
8677 | 297 |
notifyingEmergencyHandlerForUserProcesses |
298 |
"WARNING: this method belongs to NoHandlerError, and has been moved there" |
|
299 |
<resource: #obsolete> |
|
300 |
||
301 |
^ NoHandlerError notifyingEmergencyHandlerForUserProcesses |
|
302 |
! ! |
|
303 |
||
304 |
!GenericException class methodsFor:'child signal creation'! |
|
4562 | 305 |
|
8677 | 306 |
newSignal |
307 |
"create a new signal, using the receiver as a prototype and |
|
308 |
setting the parent of the new signal to the receiver." |
|
309 |
||
310 |
^ self newSignalMayProceed:self mayProceed |
|
311 |
||
312 |
"Created: / 23.7.1999 / 20:13:23 / stefan" |
|
313 |
! |
|
314 |
||
315 |
newSignalMayProceed:mayProceedBoolean |
|
316 |
"create a new signal, using the receiver as a prototype and |
|
317 |
setting the parent of the new signal to the receiver." |
|
318 |
||
319 |
|sig| |
|
4562 | 320 |
|
8677 | 321 |
self isQuerySignal ifTrue:[ |
322 |
sig := QuerySignal basicNew. |
|
323 |
mayProceedBoolean ifFalse:[ |
|
8681
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
324 |
'Exception [warning]: nonProceedable queries do not make sense' infoPrintCR. |
8677 | 325 |
]. |
326 |
] ifFalse:[ |
|
327 |
sig := Signal basicNew. |
|
328 |
]. |
|
329 |
^ sig |
|
330 |
mayProceed:mayProceedBoolean; |
|
331 |
notifierString:NotifierString; |
|
332 |
parent:self |
|
333 |
||
334 |
"Created: / 23.7.1999 / 20:12:43 / stefan" |
|
335 |
! ! |
|
336 |
||
337 |
!GenericException class methodsFor:'converting'! |
|
338 |
||
339 |
, anExceptionHandler |
|
340 |
"return a SignalSet with myself and anExceptionHandler" |
|
4562 | 341 |
|
8677 | 342 |
^ SignalSet with:self with:anExceptionHandler |
343 |
! ! |
|
344 |
||
17732
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
345 |
!GenericException class methodsFor:'misc ui support'! |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
346 |
|
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
347 |
iconInBrowserSymbol |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
348 |
<resource: #programImage> |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
349 |
|
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
350 |
^ #exceptionClassBrowserIcon |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
351 |
! ! |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
352 |
|
8677 | 353 |
!GenericException class methodsFor:'printing'! |
354 |
||
355 |
description |
|
356 |
"return the notifier string. |
|
357 |
If the notifier string starts with space, prepend |
|
358 |
the parents notifier string. |
|
359 |
Subclasses may redefine this method." |
|
360 |
||
361 |
|parent| |
|
4562 | 362 |
|
8677 | 363 |
NotifierString isNil ifTrue:[ |
364 |
^ self name asString |
|
365 |
]. |
|
366 |
(NotifierString startsWith:Character space) ifTrue:[ |
|
367 |
(parent := self parent) notNil ifTrue:[ |
|
368 |
^ parent description, NotifierString |
|
369 |
]. |
|
370 |
]. |
|
371 |
^ NotifierString |
|
372 |
||
373 |
" |
|
374 |
Object errorSignal description |
|
4562 | 375 |
" |
376 |
||
8677 | 377 |
"Created: / 23.7.1999 / 14:22:25 / stefan" |
4562 | 378 |
! ! |
379 |
||
8677 | 380 |
!GenericException class methodsFor:'queries'! |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
381 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
382 |
accepts:aSignal |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
383 |
"return true, if the receiver accepts the argument, aSignal. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
384 |
(i.e. the receiver is aSignal or a parent of it). False otherwise." |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
385 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
386 |
|s| |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
387 |
|
4527 | 388 |
self == aSignal ifTrue:[^ true]. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
389 |
aSignal isQuerySignal ifTrue:[^ false]. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
390 |
|
8681
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
391 |
s := aSignal parent. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
392 |
[s notNil] whileTrue:[ |
8617 | 393 |
self == s ifTrue:[^ true]. |
394 |
s := s parent |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
395 |
]. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
396 |
^ false |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
397 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
398 |
"Created: / 23.7.1999 / 14:00:47 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
399 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
400 |
|
9505 | 401 |
exception:anException isHandledIn:aContext |
402 |
"return true, if there is a handler for anException in the |
|
4676 | 403 |
contextChain starting with aContext." |
404 |
||
9505 | 405 |
^ (self handlerContextForException:anException in:aContext) notNil |
406 |
! |
|
407 |
||
408 |
exceptionHandlerFor:anException in:aContext |
|
409 |
"answer the exceptionHandler-block for anException from aContext." |
|
410 |
||
411 |
|sel| |
|
412 |
||
413 |
sel := aContext selector. |
|
414 |
(sel == #'handle:from:do:' |
|
415 |
or:[sel == #'handle:do:']) ifTrue:[ |
|
416 |
^ aContext receiver |
|
417 |
]. |
|
418 |
||
419 |
^ nil |
|
420 |
! |
|
421 |
||
422 |
handlerContextForException:anException in:aContext |
|
423 |
"return a handlerContext for anException in the |
|
424 |
contextChain starting with aContext. |
|
425 |
Returns nil ,if there is no handler." |
|
426 |
||
427 |
|theContext ex1 con1| |
|
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
428 |
|
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
429 |
theContext := aContext findExceptional. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
430 |
[theContext notNil] whileTrue:[ |
9505 | 431 |
theContext isRaiseContext ifTrue:[ |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
432 |
"skip all the contexts between the raise and the sender of #handle:do" |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
433 |
ex1 := theContext receiver. "exception, that has been raised" |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
434 |
con1 := ex1 handlerContext. "the context of the #handle:do:" |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
435 |
con1 notNil ifTrue:[ |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
436 |
"handlerContext may be nil, if this is a default action" |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
437 |
theContext := con1. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
438 |
]. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
439 |
ex1 := con1 := nil. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
440 |
] ifFalse:[ |r| |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
441 |
((r := theContext receiver) notNil |
9505 | 442 |
and:[(r handlerForSignal:anException context:theContext originator:nil) notNil] |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
443 |
) ifTrue:[ |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
444 |
"found a handler context" |
9505 | 445 |
^ theContext |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
446 |
]. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
447 |
]. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
448 |
theContext notNil ifTrue:[ |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
449 |
theContext := theContext findSpecialHandle:true raise:true. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
450 |
]. |
4676 | 451 |
]. |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
452 |
|
8681
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
453 |
^ nil |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
454 |
! |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
455 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
456 |
handlerForSignal:signal context:theContext originator:originator |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
457 |
"answer the handler block for the signal from originator. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
458 |
The block is retrieved from aContext. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
459 |
Answer nil if the signal is not handled" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
460 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
461 |
(theContext selector ~~ #'handle:from:do:' |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
462 |
or:[(theContext argAt:2) == originator]) ifTrue:[ |
8617 | 463 |
(self == signal or:[self accepts:signal]) ifTrue:[ |
11640
2df4e81e1dbd
changed #handlerForSignal:context:originator:
Stefan Vogel <sv@exept.de>
parents:
11621
diff
changeset
|
464 |
^ (theContext argAt:1) ? [nil] |
8617 | 465 |
] |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
466 |
]. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
467 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
468 |
^ nil |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
469 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
470 |
"Created: / 25.7.1999 / 19:52:58 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
471 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
472 |
|
4544
2a0e3853d320
#returnDoing works for any exception handler.
Stefan Vogel <sv@exept.de>
parents:
4538
diff
changeset
|
473 |
handlerProtectedBlock:doBlock inContext:context |
2a0e3853d320
#returnDoing works for any exception handler.
Stefan Vogel <sv@exept.de>
parents:
4538
diff
changeset
|
474 |
"set the handlerProtectedBlock in context" |
2a0e3853d320
#returnDoing works for any exception handler.
Stefan Vogel <sv@exept.de>
parents:
4538
diff
changeset
|
475 |
|
5590 | 476 |
|sel| |
477 |
||
478 |
sel := context selector. |
|
479 |
sel == #handle:do: ifTrue:[ |
|
8617 | 480 |
context argAt:2 put:doBlock. |
5590 | 481 |
] ifFalse:[sel == #handle:from:do: ifTrue:[ |
8617 | 482 |
context argAt:3 put:doBlock. |
4544
2a0e3853d320
#returnDoing works for any exception handler.
Stefan Vogel <sv@exept.de>
parents:
4538
diff
changeset
|
483 |
]]. |
2a0e3853d320
#returnDoing works for any exception handler.
Stefan Vogel <sv@exept.de>
parents:
4538
diff
changeset
|
484 |
! |
2a0e3853d320
#returnDoing works for any exception handler.
Stefan Vogel <sv@exept.de>
parents:
4538
diff
changeset
|
485 |
|
8681
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
486 |
handles:anException |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
487 |
"return true, if the receiver handles the argument, anException. |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
488 |
(i.e. the receiver is anExceptions signal or a parent of it)" |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
489 |
|
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
490 |
|signal| |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
491 |
|
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
492 |
signal := anException signal. |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
493 |
|
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
494 |
self == signal ifTrue:[^ true]. "quick check" |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
495 |
anException isNotification ifTrue:[^ false]. "speed up queries by not traversing the parent chain" |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
496 |
|
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
497 |
[(signal := signal parent) notNil] whileTrue:[ |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
498 |
self == signal ifTrue:[^ true]. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
499 |
]. |
8681
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
500 |
^ false |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
501 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
502 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
503 |
isHandled |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
504 |
"return true, if there is a handler for the receiver signal. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
505 |
Raising an unhandled signal will usually lead into the debugger, |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
506 |
but can be caught globally by setting Exceptions EmergencyHandler." |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
507 |
|
4676 | 508 |
^ self exception:self isHandledIn:(thisContext sender). |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
509 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
510 |
"Created: / 23.7.1999 / 14:03:50 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
511 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
512 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
513 |
isHandledIn:aContext |
8617 | 514 |
"return true, if there is a handler for the receiver signal in the |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
515 |
contextChain starting with aContext." |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
516 |
|
4676 | 517 |
^ self exception:self isHandledIn:aContext |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
518 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
519 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
520 |
parent |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
521 |
"return the parent Signal/Exception of myself. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
522 |
Subclasses may redefine this to install themself as child of |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
523 |
existing Signals." |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
524 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
525 |
self == GenericException ifTrue:[ |
8617 | 526 |
^ nil |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
527 |
]. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
528 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
529 |
^ self superclass |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
530 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
531 |
"Created: / 23.7.1999 / 14:01:29 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
532 |
"Modified: / 23.7.1999 / 16:15:38 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
533 |
! ! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
534 |
|
8677 | 535 |
!GenericException class methodsFor:'raising'! |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
536 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
537 |
raise |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
538 |
"raise a signal nonproceedable. |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
539 |
The signals notifierString is used as messageText." |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
540 |
|
4556 | 541 |
<context: #return> |
11026 | 542 |
<resource: #skipInDebuggersWalkBack> |
4556 | 543 |
|
8731 | 544 |
^ (self newException |
545 |
suspendedContext:thisContext sender) |
|
8617 | 546 |
raise |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
547 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
548 |
"Modified: / 2.5.1996 / 16:36:23 / cg" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
549 |
"Modified: / 5.3.1998 / 16:44:36 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
550 |
"Created: / 23.7.1999 / 14:07:17 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
551 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
552 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
553 |
raiseErrorString:aString |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
554 |
"raise a signal nonproceedable. |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
555 |
The argument is used as messageText." |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
556 |
|
4556 | 557 |
<context: #return> |
11026 | 558 |
<resource: #skipInDebuggersWalkBack> |
4556 | 559 |
|
8617 | 560 |
^ (self newException |
8731 | 561 |
suspendedContext:thisContext sender errorString:aString) |
8617 | 562 |
raise. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
563 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
564 |
"Modified: / 9.5.1996 / 15:17:59 / cg" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
565 |
"Modified: / 12.3.1998 / 15:15:22 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
566 |
"Created: / 23.7.1999 / 14:07:33 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
567 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
568 |
|
5684 | 569 |
raiseErrorString:aString in:aContext |
570 |
"raise a signal nonproceedable. |
|
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
571 |
The argument is used as messageText." |
5684 | 572 |
|
573 |
<context: #return> |
|
11026 | 574 |
<resource: #skipInDebuggersWalkBack> |
5684 | 575 |
|
8617 | 576 |
^ (self newException |
8731 | 577 |
suspendedContext:aContext errorString:aString) |
8617 | 578 |
raise. |
5684 | 579 |
|
580 |
"Modified: / 9.5.1996 / 15:17:59 / cg" |
|
581 |
"Modified: / 12.3.1998 / 15:15:22 / stefan" |
|
582 |
"Created: / 23.7.1999 / 14:07:33 / stefan" |
|
583 |
! |
|
584 |
||
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
585 |
raiseFrom:something |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
586 |
"raise a signal nonproceedable. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
587 |
The argument, something is passed both as parameter and originator." |
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
588 |
|
4556 | 589 |
<context: #return> |
11026 | 590 |
<resource: #skipInDebuggersWalkBack> |
4556 | 591 |
|
8731 | 592 |
^ (self newException |
593 |
suspendedContext:thisContext sender parameter:something originator:something) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
594 |
raise |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
595 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
596 |
"Modified: / 2.5.1996 / 16:36:38 / cg" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
597 |
"Modified: / 5.3.1998 / 16:49:55 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
598 |
"Created: / 23.7.1999 / 14:07:59 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
599 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
600 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
601 |
raiseRequest |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
602 |
"raise a signal proceedable. |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
603 |
The signals notifierString is used as messageText." |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
604 |
|
4556 | 605 |
<context: #return> |
11026 | 606 |
<resource: #skipInDebuggersWalkBack> |
4556 | 607 |
|
8731 | 608 |
^ (self newException |
609 |
suspendedContext:thisContext sender) |
|
8617 | 610 |
raiseRequest. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
611 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
612 |
"Modified: / 2.5.1996 / 16:36:52 / cg" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
613 |
"Modified: / 5.3.1998 / 16:50:46 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
614 |
"Created: / 23.7.1999 / 14:08:24 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
615 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
616 |
|
4758
91b5a25f29c5
added #raiseRequestErrorString
Claus Gittinger <cg@exept.de>
parents:
4676
diff
changeset
|
617 |
raiseRequestErrorString:aString |
91b5a25f29c5
added #raiseRequestErrorString
Claus Gittinger <cg@exept.de>
parents:
4676
diff
changeset
|
618 |
"raise a signal proceedable. |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
619 |
The argument, aString is used as messageText." |
4758
91b5a25f29c5
added #raiseRequestErrorString
Claus Gittinger <cg@exept.de>
parents:
4676
diff
changeset
|
620 |
|
91b5a25f29c5
added #raiseRequestErrorString
Claus Gittinger <cg@exept.de>
parents:
4676
diff
changeset
|
621 |
<context: #return> |
11026 | 622 |
<resource: #skipInDebuggersWalkBack> |
4758
91b5a25f29c5
added #raiseRequestErrorString
Claus Gittinger <cg@exept.de>
parents:
4676
diff
changeset
|
623 |
|
8731 | 624 |
^ (self newException |
625 |
suspendedContext:thisContext sender errorString:aString) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
626 |
raiseRequest |
4758
91b5a25f29c5
added #raiseRequestErrorString
Claus Gittinger <cg@exept.de>
parents:
4676
diff
changeset
|
627 |
! |
91b5a25f29c5
added #raiseRequestErrorString
Claus Gittinger <cg@exept.de>
parents:
4676
diff
changeset
|
628 |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
629 |
raiseRequestFrom:something |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
630 |
"raise a signal proceedable. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
631 |
The argument, something is passed both as parameter and originator." |
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
632 |
|
4556 | 633 |
<context: #return> |
11026 | 634 |
<resource: #skipInDebuggersWalkBack> |
4556 | 635 |
|
8731 | 636 |
^ (self newException |
637 |
suspendedContext:thisContext sender parameter:something originator:something) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
638 |
raiseRequest |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
639 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
640 |
"Modified: / 2.5.1996 / 16:36:38 / cg" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
641 |
"Modified: / 5.3.1998 / 16:52:46 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
642 |
"Created: / 23.7.1999 / 14:08:36 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
643 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
644 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
645 |
raiseRequestWith:aParameter |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
646 |
"raise a signal proceedable. |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
647 |
The signals notifierString is used as messageText." |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
648 |
|
4556 | 649 |
<context: #return> |
11026 | 650 |
<resource: #skipInDebuggersWalkBack> |
4556 | 651 |
|
8731 | 652 |
^ (self newException |
653 |
suspendedContext:thisContext sender parameter:aParameter) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
654 |
raiseRequest. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
655 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
656 |
"Modified: / 9.5.1996 / 15:13:20 / cg" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
657 |
"Modified: / 12.3.1998 / 15:16:57 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
658 |
"Created: / 23.7.1999 / 14:08:48 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
659 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
660 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
661 |
raiseRequestWith:aParameter errorString:aString |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
662 |
"raise a signal proceedable. |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
663 |
The argument, aString is used as messageText." |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
664 |
|
4556 | 665 |
<context: #return> |
11026 | 666 |
<resource: #skipInDebuggersWalkBack> |
4556 | 667 |
|
8731 | 668 |
^ (self newException |
669 |
suspendedContext:thisContext sender parameter:aParameter errorString:aString) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
670 |
raiseRequest |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
671 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
672 |
"Modified: / 9.5.1996 / 15:13:35 / cg" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
673 |
"Modified: / 12.3.1998 / 15:17:52 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
674 |
"Created: / 23.7.1999 / 14:08:57 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
675 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
676 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
677 |
raiseRequestWith:aParameter errorString:aString in:aContext |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
678 |
"raise a signal proceedable. |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
679 |
The argument, aString is used as messageText. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
680 |
The additional context is passed as the context responsible for the raise, |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
681 |
allowing a raise to mimicri the exception happened somewhere else." |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
682 |
|
8733 | 683 |
<context: #return> |
11026 | 684 |
<resource: #skipInDebuggersWalkBack> |
8733 | 685 |
|
8731 | 686 |
^ (self newException |
687 |
suspendedContext:aContext parameter:aParameter errorString:aString) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
688 |
raiseRequest |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
689 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
690 |
"Modified: / 26.7.1996 / 16:29:27 / cg" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
691 |
"Modified: / 12.3.1998 / 15:18:34 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
692 |
"Created: / 23.7.1999 / 14:09:07 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
693 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
694 |
|
5259 | 695 |
raiseRequestWith:aParameter in:aContext |
696 |
"raise a signal proceedable. |
|
697 |
The additional context is passed as the context responsible for the raise, |
|
698 |
allowing a raise to mimicri the exception happened somewhere else." |
|
699 |
||
8733 | 700 |
<context: #return> |
11026 | 701 |
<resource: #skipInDebuggersWalkBack> |
8733 | 702 |
|
8731 | 703 |
^ (self newException |
704 |
suspendedContext:aContext parameter:aParameter) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
705 |
raiseRequest |
5259 | 706 |
! |
707 |
||
6174 | 708 |
raiseSignal |
709 |
"raise a signal (proceedable or not, whatever the proceedability is). |
|
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
710 |
The signals notifierString is used as messageText." |
6174 | 711 |
|
712 |
<context: #return> |
|
11026 | 713 |
<resource: #skipInDebuggersWalkBack> |
6174 | 714 |
|
8731 | 715 |
^ (self newException |
716 |
suspendedContext:thisContext sender) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
717 |
raiseSignal |
6174 | 718 |
|
719 |
"Modified: / 10.11.2001 / 15:13:34 / cg" |
|
720 |
! |
|
721 |
||
8677 | 722 |
raiseSignal:errorMessage |
723 |
"ANSI: raise a signal (proceedable or not, whatever the proceedability is). |
|
724 |
The argument, errorMessage is used as messageText." |
|
725 |
||
726 |
<context: #return> |
|
11026 | 727 |
<resource: #skipInDebuggersWalkBack> |
8677 | 728 |
|
8731 | 729 |
^ (self newException |
730 |
suspendedContext:thisContext sender errorString:errorMessage) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
731 |
raiseSignal. |
8677 | 732 |
|
733 |
"Modified: / 07-08-2004 / 19:24:00 / stefan" |
|
734 |
! |
|
735 |
||
736 |
raiseSignal:errorMessage with:aParameter |
|
737 |
"ANSI: raise a signal (proceedable or not, whatever the proceedability is). |
|
738 |
The argument, errorMessage is used as messageText." |
|
739 |
||
740 |
<context: #return> |
|
11026 | 741 |
<resource: #skipInDebuggersWalkBack> |
8677 | 742 |
|
8731 | 743 |
^ (self newException |
744 |
suspendedContext:thisContext sender parameter:aParameter errorString:errorMessage) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
745 |
raiseSignal. |
8677 | 746 |
|
747 |
"Modified: / 07-08-2004 / 19:10:40 / stefan" |
|
748 |
! |
|
749 |
||
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
750 |
raiseSignalErrorString:aString |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
751 |
"raise a signal (proceedable or not, whatever the proceedability is). |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
752 |
The argument, aString is used as messageText." |
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
753 |
|
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
754 |
<context: #return> |
11026 | 755 |
<resource: #skipInDebuggersWalkBack> |
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
756 |
|
8731 | 757 |
^ (self newException |
758 |
suspendedContext:thisContext sender errorString:aString) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
759 |
raiseSignal. |
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
760 |
! |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
761 |
|
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
762 |
raiseSignalWith:aParameter |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
763 |
"raise a signal (proceedable or not, whatever the proceedability is). |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
764 |
The argument, aParameter is passed as parameter." |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
765 |
|
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
766 |
<context: #return> |
11026 | 767 |
<resource: #skipInDebuggersWalkBack> |
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
768 |
|
8731 | 769 |
^ (self newException |
770 |
suspendedContext:thisContext sender parameter:aParameter) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
771 |
raiseSignal. |
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
772 |
! |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
773 |
|
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
774 |
raiseSignalWith:aParameter errorString:aString |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
775 |
"raise a signal (proceedable or not, whatever the proceedability is). |
8617 | 776 |
The argument, aString is used as messageText, |
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
777 |
aParameter is passed as exception parameter." |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
778 |
|
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
779 |
<context: #return> |
11026 | 780 |
<resource: #skipInDebuggersWalkBack> |
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
781 |
|
8731 | 782 |
^ (self newException |
783 |
suspendedContext:thisContext sender parameter:aParameter errorString:aString) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
784 |
raiseSignal. |
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
785 |
! |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
786 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
787 |
raiseWith:aParameter |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
788 |
"raise a signal nonproceedable. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
789 |
The argument, aParameter is passed as parameter." |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
790 |
|
4556 | 791 |
<context: #return> |
11026 | 792 |
<resource: #skipInDebuggersWalkBack> |
4556 | 793 |
|
8731 | 794 |
^ (self newException |
795 |
suspendedContext:thisContext sender parameter:aParameter) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
796 |
raise. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
797 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
798 |
"Modified: / 9.5.1996 / 15:14:24 / cg" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
799 |
"Modified: / 12.3.1998 / 15:19:11 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
800 |
"Created: / 23.7.1999 / 14:09:27 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
801 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
802 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
803 |
raiseWith:aParameter errorString:aString |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
804 |
"raise a signal nonproceedable. |
8617 | 805 |
The argument, aString is used as messageText, |
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
806 |
aParameter is passed as exception parameter." |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
807 |
|
4556 | 808 |
<context: #return> |
11026 | 809 |
<resource: #skipInDebuggersWalkBack> |
4556 | 810 |
|
8731 | 811 |
^ (self newException |
812 |
suspendedContext:thisContext sender parameter:aParameter errorString:aString) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
813 |
raise. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
814 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
815 |
"Modified: / 9.5.1996 / 15:14:32 / cg" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
816 |
"Modified: / 12.3.1998 / 15:19:40 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
817 |
"Created: / 23.7.1999 / 14:09:36 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
818 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
819 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
820 |
raiseWith:aParameter errorString:aString in:aContext |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
821 |
"raise a signal nonproceedable. |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
822 |
The argument, aString is used as messageText, aParameter is passed |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
823 |
as exception parameter. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
824 |
The additional context is passed as the context responsible for the raise, |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
825 |
allowing a raise to mimicri the exception happened somewhere else." |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
826 |
|
8733 | 827 |
<context: #return> |
11026 | 828 |
<resource: #skipInDebuggersWalkBack> |
8733 | 829 |
|
8731 | 830 |
^ (self newException |
831 |
suspendedContext:aContext parameter:aParameter errorString:aString) |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
832 |
raise. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
833 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
834 |
"Modified: / 26.7.1996 / 16:29:42 / cg" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
835 |
"Modified: / 12.3.1998 / 15:20:12 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
836 |
"Created: / 23.7.1999 / 14:09:46 / stefan" |
8677 | 837 |
! |
838 |
||
10753 | 839 |
raiseWith:aParameter in:aContext |
840 |
"raise a signal nonproceedable. |
|
841 |
The argument, aParameter is passed as exception parameter. |
|
842 |
The additional context is passed as the context responsible for the raise, |
|
843 |
allowing a raise to mimicri the exception happened somewhere else." |
|
844 |
||
845 |
<context: #return> |
|
11026 | 846 |
<resource: #skipInDebuggersWalkBack> |
10753 | 847 |
|
848 |
^ (self newException |
|
849 |
suspendedContext:aContext parameter:aParameter) |
|
850 |
raise. |
|
851 |
! |
|
852 |
||
8677 | 853 |
signalWith:messageText |
854 |
"ANSI compatibility" |
|
855 |
||
11026 | 856 |
<resource: #skipInDebuggersWalkBack> |
857 |
||
8677 | 858 |
self raiseErrorString:messageText |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
859 |
! ! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
860 |
|
8677 | 861 |
!GenericException class methodsFor:'save evaluation'! |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
862 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
863 |
catch:aBlock |
4496 | 864 |
"evaluate the argument, aBlock. |
10239 | 865 |
If the receiver-exception is raised during evaluation, abort |
8617 | 866 |
the evaluation and return true; otherwise return false. |
4496 | 867 |
This is the catch & throw mechanism found in other languages, |
868 |
where the returned value indicates if an exception occured." |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
869 |
|
4496 | 870 |
|raiseOccurred| |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
871 |
|
4496 | 872 |
raiseOccurred := false. |
873 |
self handle:[:ex | raiseOccurred := true. ex return] do:aBlock. |
|
874 |
^ raiseOccurred |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
875 |
|
4496 | 876 |
" |
877 |
Object messageNotUnderstoodSignal catch:[ |
|
8617 | 878 |
123 size open |
879 |
] |
|
4496 | 880 |
" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
881 |
|
10239 | 882 |
"Created: / 23-07-1999 / 14:06:01 / stefan" |
883 |
"Modified: / 07-12-2006 / 17:05:17 / cg" |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
884 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
885 |
|
6396
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
886 |
deferAfter:aBlock |
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
887 |
"evaluate the argument, aBlock. |
10239 | 888 |
Ignore the receiver-exception during evaluation - i.e. simply continue, |
6396
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
889 |
but remember if the signal was raised. |
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
890 |
After the block evaluation, finally raise the signal - if it was raised in the block. |
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
891 |
If the signal is raised multiple times, only the first raises parameter is remembered, |
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
892 |
and only a single raise is performed after the blocks evaluation. |
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
893 |
|
8617 | 894 |
Deferring makes sense for some signals, such as UserInterrupt or AbortSignal, |
895 |
which must occasionally be delayed temporarily until a save place is reached |
|
6396
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
896 |
(especially when packages are sent across a communication channel, and you dont want |
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
897 |
partial packages to be generated by user interruptions)." |
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
898 |
|
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
899 |
|coughtException result| |
6396
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
900 |
|
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
901 |
self handle:[:ex | |
8617 | 902 |
coughtException isNil ifTrue:[ |
903 |
coughtException := ex. |
|
904 |
]. |
|
905 |
ex proceedWith:nil |
|
6396
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
906 |
] do:[ |
8617 | 907 |
result := aBlock value. |
6396
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
908 |
]. |
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
909 |
coughtException notNil ifTrue:[ |
8617 | 910 |
coughtException suspendedContext:thisContext. |
911 |
||
912 |
"/ the exception was raised during the execution of aBlock above. |
|
913 |
"/ Raise it now (delayed). |
|
914 |
coughtException raiseSignal. |
|
6396
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
915 |
]. |
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
916 |
^ result |
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
917 |
|
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
918 |
" |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
919 |
UserInterrupt deferAfter:[ |
8617 | 920 |
Transcript showCR:'1 - now raising, but will be deferred.'. |
921 |
UserInterrupt raiseRequestWith:'hello'. |
|
922 |
Transcript showCR:'2 - after the raise, deferred exception will be handled soon.'. |
|
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
923 |
]. |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
924 |
Transcript showCR:'3 - here after the protected block.'. |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
925 |
" |
10239 | 926 |
|
927 |
"Modified: / 07-12-2006 / 17:05:28 / cg" |
|
6396
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
928 |
! |
74d5b0b588a6
added deferAfter: - defer exceptions until some later time
Claus Gittinger <cg@exept.de>
parents:
6364
diff
changeset
|
929 |
|
17732
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
930 |
evaluate:aBlock ifRaised:exceptionValue |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
931 |
"evaluate the argument, aBlock and return its value. |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
932 |
If the receiver-signal is raised during evaluation, abort |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
933 |
the evaluation and return the value from exceptionValue. |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
934 |
This is similar to the catch & throw mechanism found in other languages" |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
935 |
|
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
936 |
^ self handle:[:ex | exceptionValue value] do:aBlock. |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
937 |
|
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
938 |
" |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
939 |
Object messageNotUnderstoodSignal |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
940 |
evaluate:[ 123 size open ] |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
941 |
ifRaised:345 |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
942 |
" |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
943 |
! |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
944 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
945 |
handle:handleBlock do:aBlock |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
946 |
"evaluate the argument, aBlock. |
10239 | 947 |
If the receiver-exception is raised during evaluation, |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
948 |
evaluate the handleBlock passing it an Exception argument. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
949 |
The handler may decide how to react to the signal by sending |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
950 |
a corresponding message to the exception (see there). |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
951 |
If the signal is not raised, return the value of evaluating |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
952 |
aBlock." |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
953 |
|
4548
8349abc6b796
Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents:
4544
diff
changeset
|
954 |
<context: #return> |
4488
db914d752859
must mark returned contexts as returnable
Claus Gittinger <cg@exept.de>
parents:
4484
diff
changeset
|
955 |
<exception: #handle> |
db914d752859
must mark returned contexts as returnable
Claus Gittinger <cg@exept.de>
parents:
4484
diff
changeset
|
956 |
|
4491
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
957 |
"/ thisContext markForHandle. -- same as above pragma |
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
958 |
^ aBlock value "the real logic is in Exception>>doRaise" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
959 |
|
4491
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
960 |
" |
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
961 |
Object messageNotUnderstoodSignal handle:[:ex | |
8617 | 962 |
'oops' printNL. |
963 |
ex return |
|
4491
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
964 |
] do:[ |
8617 | 965 |
123 size open |
4491
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
966 |
] |
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
967 |
" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
968 |
|
4491
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
969 |
" |
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
970 |
|num| |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
971 |
|
4491
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
972 |
num := 0. |
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
973 |
Number divisionByZeroSignal handle:[:ex | |
8617 | 974 |
'oops' printNL. |
975 |
ex return |
|
4491
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
976 |
] do:[ |
8617 | 977 |
123 / num |
4491
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
978 |
] |
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
979 |
" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
980 |
|
10239 | 981 |
"Created: / 23-07-1999 / 14:06:13 / stefan" |
982 |
"Modified: / 25-07-1999 / 19:44:05 / stefan" |
|
983 |
"Modified: / 07-12-2006 / 17:05:30 / cg" |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
984 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
985 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
986 |
handle:handleBlock from:anObject do:aBlock |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
987 |
"evaluate the argument, aBlock. |
10239 | 988 |
If the receiver-exception is raised during evaluation, |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
989 |
and the exception originated from anObject, |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
990 |
evaluate the handleBlock passing it an Exception argument. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
991 |
The handler may decide how to react to the signal by sending |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
992 |
a corresponding message to the exception (see there). |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
993 |
If the signal is not raised, return the value of evaluating |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
994 |
aBlock." |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
995 |
|
4548
8349abc6b796
Add #handlerProtectedBlock:inContext
Stefan Vogel <sv@exept.de>
parents:
4544
diff
changeset
|
996 |
<context: #return> |
4488
db914d752859
must mark returned contexts as returnable
Claus Gittinger <cg@exept.de>
parents:
4484
diff
changeset
|
997 |
<exception: #handle> |
db914d752859
must mark returned contexts as returnable
Claus Gittinger <cg@exept.de>
parents:
4484
diff
changeset
|
998 |
|
4491
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
999 |
"/ thisContext markForHandle. -- same as above pragma |
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
1000 |
^ aBlock value "the real logic is in Exception>>doRaise" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1001 |
|
4491
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
1002 |
" |
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
1003 |
the first open will be caught; the second not: |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1004 |
|
4491
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
1005 |
|o1 o2| |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1006 |
|
4491
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
1007 |
o1 := 123. |
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
1008 |
o2 := nil. |
8617 | 1009 |
Object messageNotUnderstoodSignal |
1010 |
handle: |
|
1011 |
[:ex | |
|
1012 |
'oops' printNL. |
|
1013 |
ex proceed |
|
1014 |
] |
|
1015 |
from:o1 |
|
1016 |
do: |
|
1017 |
[ |
|
1018 |
o1 open. |
|
1019 |
o2 open |
|
1020 |
] |
|
4491
5041cae5651c
use new pragma to flag exception frames.
Claus Gittinger <cg@exept.de>
parents:
4488
diff
changeset
|
1021 |
" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1022 |
|
10239 | 1023 |
"Created: / 23-07-1999 / 14:06:26 / stefan" |
1024 |
"Modified: / 25-07-1999 / 19:44:13 / stefan" |
|
1025 |
"Modified: / 07-12-2006 / 17:05:33 / cg" |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1026 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1027 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1028 |
ignoreIn:aBlock |
4496 | 1029 |
"evaluate the argument, aBlock. |
10239 | 1030 |
Ignore the receiver-exception during evaluation - i.e. simply continue. |
4496 | 1031 |
This makes only sense for some signals, such as UserInterrupt |
1032 |
or AbortSignal, because continuing after an exception without any cleanup |
|
1033 |
often leads to followup-errors." |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1034 |
|
4496 | 1035 |
^ self handle:[:ex | ex proceedWith:nil] do:aBlock. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1036 |
|
4496 | 1037 |
" |
1038 |
Object messageNotUnderstoodSignal ignoreIn:[ |
|
8617 | 1039 |
123 size open |
4496 | 1040 |
] |
1041 |
" |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1042 |
|
10239 | 1043 |
"Created: / 23-07-1999 / 14:06:40 / stefan" |
1044 |
"Modified: / 07-12-2006 / 17:05:35 / cg" |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1045 |
! ! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1046 |
|
8677 | 1047 |
!GenericException class methodsFor:'testing'! |
6200 | 1048 |
|
1049 |
isControlInterrupt |
|
1050 |
^ false |
|
1051 |
||
1052 |
"Created: / 16.11.2001 / 16:11:54 / cg" |
|
4936 | 1053 |
! |
1054 |
||
8677 | 1055 |
isExceptionCreator |
1056 |
"return true, if the receiver can create exceptions, |
|
1057 |
this includes #raise, #raiseRequest as well as the behavior of |
|
1058 |
an exception handler, such as the #accepts: and #handles: messages" |
|
8254
73b6109ab982
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8238
diff
changeset
|
1059 |
|
8677 | 1060 |
^ true |
4936 | 1061 |
! |
1062 |
||
8677 | 1063 |
isExceptionHandler |
1064 |
"return true, if the receiver responds to the exception handler protocol, |
|
1065 |
especially to the #accepts: and #handles: messages" |
|
8254
73b6109ab982
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8238
diff
changeset
|
1066 |
|
8677 | 1067 |
^ true |
8254
73b6109ab982
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8238
diff
changeset
|
1068 |
|
8677 | 1069 |
"Created: / 23.7.1999 / 13:49:59 / stefan" |
4936 | 1070 |
! |
1071 |
||
8677 | 1072 |
isQuerySignal |
1073 |
"return true, if this is a querySignal - always return false here" |
|
4936 | 1074 |
|
8677 | 1075 |
^ false |
4936 | 1076 |
|
8677 | 1077 |
"Created: / 23.7.1999 / 13:50:16 / stefan" |
5058
42e732f3497c
added another useful handler
Claus Gittinger <cg@exept.de>
parents:
4936
diff
changeset
|
1078 |
! |
42e732f3497c
added another useful handler
Claus Gittinger <cg@exept.de>
parents:
4936
diff
changeset
|
1079 |
|
8677 | 1080 |
mayProceed |
1081 |
"return true, if the exception handler is allowed to proceed |
|
1082 |
the execution where the exception occured. |
|
8390
d78cd984f201
return values for #proceedWith:
Stefan Vogel <sv@exept.de>
parents:
8313
diff
changeset
|
1083 |
|
8677 | 1084 |
Subclasses may redefine this." |
5058
42e732f3497c
added another useful handler
Claus Gittinger <cg@exept.de>
parents:
4936
diff
changeset
|
1085 |
|
8677 | 1086 |
^ true |
5058
42e732f3497c
added another useful handler
Claus Gittinger <cg@exept.de>
parents:
4936
diff
changeset
|
1087 |
|
8677 | 1088 |
"Modified: / 23.7.1999 / 14:50:11 / stefan" |
4936 | 1089 |
! ! |
1090 |
||
7261 | 1091 |
!GenericException methodsFor:'Compatibility-ANSI'! |
5680 | 1092 |
|
5933
af2939dac9bf
added #pass for compatibility
Claus Gittinger <cg@exept.de>
parents:
5927
diff
changeset
|
1093 |
pass |
af2939dac9bf
added #pass for compatibility
Claus Gittinger <cg@exept.de>
parents:
5927
diff
changeset
|
1094 |
^ self reject |
af2939dac9bf
added #pass for compatibility
Claus Gittinger <cg@exept.de>
parents:
5927
diff
changeset
|
1095 |
! |
af2939dac9bf
added #pass for compatibility
Claus Gittinger <cg@exept.de>
parents:
5927
diff
changeset
|
1096 |
|
5985 | 1097 |
retry |
1098 |
"same as #restart - ANSI & VW compatibility" |
|
1099 |
||
1100 |
self restart |
|
1101 |
||
1102 |
"Created: / 7.9.2001 / 13:31:02 / cg" |
|
1103 |
! |
|
1104 |
||
7674 | 1105 |
retryUsing: alternativeBlock |
1106 |
"Abort an exception handler and evaluate a new block in place of the handler's protected block." |
|
1107 |
||
1108 |
"/ self mustBeHandled ifFalse: [ ^self ]. |
|
1109 |
||
1110 |
^ self restartDo:alternativeBlock |
|
1111 |
! |
|
1112 |
||
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1113 |
signalWith:messageText |
8677 | 1114 |
self messageText:messageText. |
1115 |
^ self raise |
|
5697
ce78c7d9ddbd
raiseSignal / raiseSignal: / raiseSignal:with:
Claus Gittinger <cg@exept.de>
parents:
5684
diff
changeset
|
1116 |
! ! |
5680 | 1117 |
|
17735 | 1118 |
!GenericException methodsFor:'Compatibility-Dolphin'! |
1119 |
||
1120 |
stackTrace:numberOfFrames |
|
1121 |
"return a backtrace information string" |
|
1122 |
||
1123 |
|con| |
|
1124 |
||
1125 |
con := suspendedContext. |
|
1126 |
^ ((1 to:numberOfFrames) |
|
1127 |
collect:[:idx | |
|
1128 |
|s| |
|
1129 |
||
1130 |
s := con printString. |
|
1131 |
con := con sender. |
|
1132 |
s |
|
1133 |
]) asStringWith:Character cr. |
|
1134 |
||
1135 |
" |
|
1136 |
Error handle:[:ex | |
|
1137 |
(ex stackTrace:20) inspect. |
|
1138 |
] do:[ |
|
1139 |
self error |
|
1140 |
]. |
|
1141 |
" |
|
1142 |
! ! |
|
1143 |
||
17736 | 1144 |
!GenericException methodsFor:'Compatibility-Squeak'! |
1145 |
||
1146 |
signalerContext |
|
1147 |
^ self suspendedContext |
|
1148 |
! ! |
|
1149 |
||
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1150 |
!GenericException methodsFor:'accessing'! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1151 |
|
10777 | 1152 |
catchInDebugger |
1153 |
"if set, the debugger will handle this signal in its event loop and will close itself |
|
1154 |
without asking for close-confirmation. |
|
1155 |
This allows for debugged processes to be terminated without a user confirmation dialog |
|
1156 |
(for now, this is used in expecco's hard-terminate function to shut down any open debuggers |
|
11710
8e6d1d366d30
added dummy catchInDebugger
Claus Gittinger <cg@exept.de>
parents:
11640
diff
changeset
|
1157 |
together with the test-process). |
8e6d1d366d30
added dummy catchInDebugger
Claus Gittinger <cg@exept.de>
parents:
11640
diff
changeset
|
1158 |
Dummy here" |
10777 | 1159 |
|
1160 |
^ false |
|
1161 |
! |
|
1162 |
||
11710
8e6d1d366d30
added dummy catchInDebugger
Claus Gittinger <cg@exept.de>
parents:
11640
diff
changeset
|
1163 |
catchInDebugger:aBoolean |
8e6d1d366d30
added dummy catchInDebugger
Claus Gittinger <cg@exept.de>
parents:
11640
diff
changeset
|
1164 |
"if set, the debugger will handle this signal in its event loop and will close itself |
8e6d1d366d30
added dummy catchInDebugger
Claus Gittinger <cg@exept.de>
parents:
11640
diff
changeset
|
1165 |
without asking for close-confirmation. |
8e6d1d366d30
added dummy catchInDebugger
Claus Gittinger <cg@exept.de>
parents:
11640
diff
changeset
|
1166 |
This allows for debugged processes to be terminated without a user confirmation dialog |
8e6d1d366d30
added dummy catchInDebugger
Claus Gittinger <cg@exept.de>
parents:
11640
diff
changeset
|
1167 |
(for now, this is used in expecco's hard-terminate function to shut down any open debuggers |
8e6d1d366d30
added dummy catchInDebugger
Claus Gittinger <cg@exept.de>
parents:
11640
diff
changeset
|
1168 |
together with the test-process). |
8e6d1d366d30
added dummy catchInDebugger
Claus Gittinger <cg@exept.de>
parents:
11640
diff
changeset
|
1169 |
Dummy here" |
8e6d1d366d30
added dummy catchInDebugger
Claus Gittinger <cg@exept.de>
parents:
11640
diff
changeset
|
1170 |
|
8e6d1d366d30
added dummy catchInDebugger
Claus Gittinger <cg@exept.de>
parents:
11640
diff
changeset
|
1171 |
"/ ignored |
8e6d1d366d30
added dummy catchInDebugger
Claus Gittinger <cg@exept.de>
parents:
11640
diff
changeset
|
1172 |
! |
8e6d1d366d30
added dummy catchInDebugger
Claus Gittinger <cg@exept.de>
parents:
11640
diff
changeset
|
1173 |
|
4562 | 1174 |
creator |
1175 |
"return the creator of the exception" |
|
1176 |
||
1177 |
^ signal |
|
1178 |
! |
|
1179 |
||
8617 | 1180 |
errorString |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1181 |
"return the errorString passsed with the signal raise |
4562 | 1182 |
(or nil, if there was none). |
1183 |
#errorString is deprecated, use description instead" |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1184 |
|
6859
5ef85865e8db
Print exception description with #printOn:
Stefan Vogel <sv@exept.de>
parents:
6630
diff
changeset
|
1185 |
<resource:#obsolete> |
4562 | 1186 |
|
1187 |
^ self description |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1188 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1189 |
"Modified: / 12.3.1998 / 15:13:28 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1190 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1191 |
|
8617 | 1192 |
errorString:aString |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1193 |
"set the messageText. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1194 |
If it starts with a space, the signals messageText is prepended, |
4562 | 1195 |
if it ends with a space, it is appended. |
1196 |
#errorString: is deprecated, use messageText: instead" |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1197 |
|
6859
5ef85865e8db
Print exception description with #printOn:
Stefan Vogel <sv@exept.de>
parents:
6630
diff
changeset
|
1198 |
<resource:#obsolete> |
5ef85865e8db
Print exception description with #printOn:
Stefan Vogel <sv@exept.de>
parents:
6630
diff
changeset
|
1199 |
|
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1200 |
messageText := aString |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1201 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1202 |
"Created: / 5.3.1998 / 16:45:29 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1203 |
"Modified: / 12.3.1998 / 15:30:45 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1204 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1205 |
|
8681
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1206 |
handler |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1207 |
"return the exception handler (Signal or SignalSet or ExceptionHandlerSet or Exception) |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1208 |
that handles the exception. |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1209 |
This is only valid during handler evaluation, and answers |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1210 |
the object which accepted the actual exception." |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1211 |
|
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1212 |
handlerContext isNil ifTrue:[ |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1213 |
^ nil. |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1214 |
]. |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1215 |
^ handlerContext receiver exceptionHandlerFor:self in:handlerContext. |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1216 |
|
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1217 |
" |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1218 |
[ |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1219 |
2 // 0 |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1220 |
] on:Error do:[:ex| ex handler inspect] |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1221 |
|
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1222 |
[ |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1223 |
2 // 0 |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1224 |
] on:ArithmeticError, Error do:[:ex| ex handler inspect] |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1225 |
|
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1226 |
[ |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1227 |
2 // 0 |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1228 |
] on:MessageNotUnderstood do:[:ex| ex handler inspect] |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1229 |
on:Error do:[:ex| ex handler inspect] |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1230 |
" |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1231 |
! |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1232 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1233 |
handlerContext |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1234 |
"return the context of the handler" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1235 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1236 |
^ handlerContext |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1237 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1238 |
|
4483 | 1239 |
handlingException |
8681
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1240 |
<resource: #obsolete> |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
1241 |
^ self handler |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1242 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1243 |
|
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1244 |
isResumable |
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1245 |
"return true, if the exception is resumable" |
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1246 |
|
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1247 |
^ proceedable |
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1248 |
|
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1249 |
"Modified: / 2.3.1998 / 12:20:43 / stefan" |
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1250 |
! |
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1251 |
|
7597 | 1252 |
isResumable:aBoolean |
1253 |
proceedable := aBoolean |
|
1254 |
! |
|
1255 |
||
5950 | 1256 |
messageText |
7808 | 1257 |
"return the explicit given messageText - nil, if signaler did not provide one." |
5950 | 1258 |
|
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1259 |
^ messageText |
5950 | 1260 |
! |
1261 |
||
8617 | 1262 |
messageText:aString |
4562 | 1263 |
"set the messageText. |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1264 |
If it starts with a space, the signals messageText is prepended, |
4562 | 1265 |
if it ends with a space, it is appended." |
1266 |
||
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1267 |
messageText := aString |
4562 | 1268 |
|
1269 |
"Created: / 5.3.1998 / 16:45:29 / stefan" |
|
1270 |
"Modified: / 12.3.1998 / 15:30:45 / stefan" |
|
1271 |
! |
|
1272 |
||
8617 | 1273 |
originator |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1274 |
"return the originator passsed with the signal raise |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1275 |
(or nil, if there was none)" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1276 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1277 |
^ originator |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1278 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1279 |
|
8617 | 1280 |
originator:anObject |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1281 |
"set the originator" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1282 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1283 |
originator := anObject |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1284 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1285 |
"Created: / 5.3.1998 / 16:34:56 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1286 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1287 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1288 |
parameter |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1289 |
"return the parameter passsed with the signal raise |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1290 |
(or nil, if there was none)" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1291 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1292 |
^ parameter |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1293 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1294 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1295 |
parameter:anObject |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1296 |
"set the parameter of the exception" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1297 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1298 |
parameter := anObject |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1299 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1300 |
"Created: / 5.3.1998 / 16:34:22 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1301 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1302 |
|
6036 | 1303 |
proceedable:aBoolean |
1304 |
proceedable := aBoolean |
|
1305 |
! |
|
1306 |
||
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1307 |
raiseContext |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1308 |
^ raiseContext |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1309 |
! |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1310 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1311 |
rejected |
8617 | 1312 |
"return true, if any other of the exceptions handlers has rejected |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1313 |
Uncertain, if this is really interesting to anybody. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1314 |
This is only valid during handler execution. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1315 |
(i.e. an outer handler can find out, if any other handler has already |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1316 |
rejected). |
8617 | 1317 |
Currently only used to change the 'unhandled-exception' messageText |
11234
65c3be6b0d72
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
11026
diff
changeset
|
1318 |
into 'rejected-exception' for the information, that there was a handler which rejected. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1319 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1320 |
|
4564 | 1321 |
^ rejected == true |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1322 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1323 |
|
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1324 |
returnableSuspendedContext |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1325 |
"return a nearest returnable context above suspendedContext in the sender chain. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1326 |
We know, that raiseContext is always returnable, so if suspendedContext |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1327 |
is non-returnable, start there" |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1328 |
|
10389 | 1329 |
|returnableContext nextContext| |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1330 |
|
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1331 |
returnableContext := suspendedContext. |
10389 | 1332 |
returnableContext canReturn ifFalse:[ |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1333 |
"the context that triggered the exception cannot return. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1334 |
This is a fallback: return the the context of the raise*. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1335 |
We know, that this context is returnable" |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1336 |
|
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1337 |
returnableContext := nextContext := raiseContext. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1338 |
"find the returnable context that is the nearest in the sender chain |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1339 |
to suspendedContext...." |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1340 |
[ |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1341 |
nextContext := nextContext sender. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1342 |
nextContext isNil ifTrue:[ |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1343 |
"suspendedContext appears to not exist on sender chain..." |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1344 |
^ raiseContext. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1345 |
]. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1346 |
nextContext canReturn ifTrue:[ |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1347 |
returnableContext := nextContext. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1348 |
]. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1349 |
nextContext ~~ suspendedContext. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1350 |
] whileTrue. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1351 |
]. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1352 |
^ returnableContext |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1353 |
! |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1354 |
|
8617 | 1355 |
searchFrom:raisingContext |
5697
ce78c7d9ddbd
raiseSignal / raiseSignal: / raiseSignal:with:
Claus Gittinger <cg@exept.de>
parents:
5684
diff
changeset
|
1356 |
suspendedContext := raisingContext |
ce78c7d9ddbd
raiseSignal / raiseSignal: / raiseSignal:with:
Claus Gittinger <cg@exept.de>
parents:
5684
diff
changeset
|
1357 |
! |
ce78c7d9ddbd
raiseSignal / raiseSignal: / raiseSignal:with:
Claus Gittinger <cg@exept.de>
parents:
5684
diff
changeset
|
1358 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1359 |
signal |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1360 |
"return the signal, that caused the exception" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1361 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1362 |
^ signal |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1363 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1364 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1365 |
signal:aSignal |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1366 |
"set the signal, that caused the exception" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1367 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1368 |
signal := aSignal |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1369 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1370 |
"Created: / 5.3.1998 / 16:02:46 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1371 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1372 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1373 |
suspendedContext |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1374 |
"return the context in which the raise occured" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1375 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1376 |
^ suspendedContext |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1377 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1378 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1379 |
suspendedContext:something |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1380 |
"set the value of the instance variable 'suspendedContext' (automatically generated)" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1381 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1382 |
suspendedContext := something. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1383 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1384 |
"Created: / 2.3.1998 / 12:43:20 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1385 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1386 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1387 |
willProceed |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1388 |
"return true, if the exception is proceedable" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1389 |
|
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1390 |
^ self isResumable |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1391 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1392 |
"Modified: / 2.3.1998 / 12:20:43 / stefan" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1393 |
! ! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1394 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1395 |
!GenericException methodsFor:'copying'! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1396 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1397 |
postCopy |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1398 |
"set the internal state to nil" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1399 |
|
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1400 |
raiseContext := suspendedContext := handlerContext := rejected := nil |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1401 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1402 |
"Created: / 2.3.1998 / 12:30:06 / stefan" |
8931 | 1403 |
! |
1404 |
||
1405 |
postDeepCopy |
|
1406 |
"set the internal state to nil" |
|
1407 |
||
1408 |
suspendedContext := handlerContext := rejected := nil |
|
1409 |
||
1410 |
"Created: / 2.3.1998 / 12:30:06 / stefan" |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1411 |
! ! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1412 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1413 |
!GenericException methodsFor:'default actions'! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1414 |
|
4527 | 1415 |
defaultAction |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1416 |
"perform a action for the exception if it hasn't been catched |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1417 |
We arrive here, if either no handler was found, or none of the |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1418 |
handlers did a return (i.e. every handler rejected). |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1419 |
|
8617 | 1420 |
The default is to evaluate the signal's handlerBlock or |
4562 | 1421 |
to raise the noHandlerSignal. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1422 |
Subclasses may redefine this." |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1423 |
|
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1424 |
<context: #return> |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1425 |
|
4562 | 1426 |
|handlerBlock| |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1427 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1428 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1429 |
try per signal handler |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1430 |
" |
4562 | 1431 |
(handlerBlock := signal handlerBlock) notNil ifTrue:[ |
8617 | 1432 |
"... and call it" |
1433 |
^ handlerBlock value:self. |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1434 |
]. |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1435 |
|
4562 | 1436 |
^ self noHandler. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1437 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1438 |
"Created: / 23.7.1999 / 14:38:03 / stefan" |
4517
8c539600fb63
Implement NoHandlerException etc. as class based exceptions.
Stefan Vogel <sv@exept.de>
parents:
4513
diff
changeset
|
1439 |
"Modified: / 4.8.1999 / 08:11:05 / stefan" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1440 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1441 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1442 |
mayProceed |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1443 |
"return true, if the exception handler is allowed to proceed |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1444 |
the execution where the exception occured. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1445 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1446 |
Subclasses may redefine this." |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1447 |
|
6920
ff7892b5b41a
no longer raise ProceedError
Claus Gittinger <cg@exept.de>
parents:
6859
diff
changeset
|
1448 |
proceedable notNil ifTrue:[^ proceedable]. |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1449 |
^ signal mayProceed. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1450 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1451 |
"Created: / 23.7.1999 / 14:48:26 / stefan" |
4562 | 1452 |
! |
1453 |
||
1454 |
noHandler |
|
1455 |
"raise the NoHandlerError. |
|
1456 |
NohandlerError redefines this method to avoid recursive invocations" |
|
1457 |
||
4564 | 1458 |
<context: #return> |
1459 |
||
4562 | 1460 |
|msg| |
1461 |
||
4564 | 1462 |
rejected == true ifTrue:[ |
8390
d78cd984f201
return values for #proceedWith:
Stefan Vogel <sv@exept.de>
parents:
8313
diff
changeset
|
1463 |
msg := 'unhandled (rejected)' |
4562 | 1464 |
] ifFalse:[ |
8390
d78cd984f201
return values for #proceedWith:
Stefan Vogel <sv@exept.de>
parents:
8313
diff
changeset
|
1465 |
msg := 'unhandled' |
4562 | 1466 |
]. |
5295 | 1467 |
msg := msg , ' exception: (' , self description , ')'. |
4564 | 1468 |
self mayProceed ifTrue:[ |
8617 | 1469 |
^ NoHandlerError |
1470 |
raiseRequestWith:self |
|
8390
d78cd984f201
return values for #proceedWith:
Stefan Vogel <sv@exept.de>
parents:
8313
diff
changeset
|
1471 |
errorString:msg |
d78cd984f201
return values for #proceedWith:
Stefan Vogel <sv@exept.de>
parents:
8313
diff
changeset
|
1472 |
in:suspendedContext. |
4564 | 1473 |
]. |
8617 | 1474 |
^ NoHandlerError |
1475 |
raiseWith:self |
|
8390
d78cd984f201
return values for #proceedWith:
Stefan Vogel <sv@exept.de>
parents:
8313
diff
changeset
|
1476 |
errorString:msg |
d78cd984f201
return values for #proceedWith:
Stefan Vogel <sv@exept.de>
parents:
8313
diff
changeset
|
1477 |
in:suspendedContext. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1478 |
! ! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1479 |
|
5984
2d5c04c9fab6
ANSI; added #defaultResumeValue and #defaultReturnValue.
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1480 |
!GenericException methodsFor:'default values'! |
2d5c04c9fab6
ANSI; added #defaultResumeValue and #defaultReturnValue.
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1481 |
|
2d5c04c9fab6
ANSI; added #defaultResumeValue and #defaultReturnValue.
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1482 |
defaultResumeValue |
2d5c04c9fab6
ANSI; added #defaultResumeValue and #defaultReturnValue.
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1483 |
^ nil |
2d5c04c9fab6
ANSI; added #defaultResumeValue and #defaultReturnValue.
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1484 |
! |
2d5c04c9fab6
ANSI; added #defaultResumeValue and #defaultReturnValue.
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1485 |
|
2d5c04c9fab6
ANSI; added #defaultResumeValue and #defaultReturnValue.
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1486 |
defaultReturnValue |
2d5c04c9fab6
ANSI; added #defaultResumeValue and #defaultReturnValue.
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1487 |
^ nil |
2d5c04c9fab6
ANSI; added #defaultResumeValue and #defaultReturnValue.
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1488 |
! ! |
2d5c04c9fab6
ANSI; added #defaultResumeValue and #defaultReturnValue.
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1489 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1490 |
!GenericException methodsFor:'handler actions'! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1491 |
|
5985 | 1492 |
exit |
1493 |
"either resume or return - depending on the receivers resumability. |
|
1494 |
VW compatibility." |
|
1495 |
||
1496 |
self isResumable ifTrue:[ |
|
8617 | 1497 |
self resume:(self defaultResumeValue) |
5985 | 1498 |
] ifFalse:[ |
8617 | 1499 |
self return:(self defaultReturnValue) |
5985 | 1500 |
] |
1501 |
||
1502 |
"Modified: / 7.9.2001 / 13:28:54 / cg" |
|
1503 |
! |
|
1504 |
||
1505 |
exit:value |
|
1506 |
"either resume or return - depending on the receivers resumability. |
|
1507 |
VW compatibility." |
|
1508 |
||
1509 |
self isResumable ifTrue:[ |
|
8617 | 1510 |
self resume:value |
5985 | 1511 |
] ifFalse:[ |
8617 | 1512 |
self return:value |
5985 | 1513 |
] |
1514 |
||
1515 |
"Created: / 7.9.2001 / 13:29:55 / cg" |
|
1516 |
"Modified: / 7.9.2001 / 13:30:00 / cg" |
|
1517 |
! |
|
1518 |
||
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1519 |
proceed |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1520 |
"Continue after the raise - the raise returns nil" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1521 |
|
5984
2d5c04c9fab6
ANSI; added #defaultResumeValue and #defaultReturnValue.
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1522 |
self proceedWith:(self defaultResumeValue). |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1523 |
|
8617 | 1524 |
"cg: a strange example: |
1525 |
there are two cought errors here - can you spot them ? |
|
4556 | 1526 |
|
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1527 |
Error handle:[:ex| |
8617 | 1528 |
'proceeding' printCR. |
1529 |
ex proceed |
|
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1530 |
] do:[ |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1531 |
Error raiseRequest |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1532 |
]. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1533 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1534 |
|
4517
8c539600fb63
Implement NoHandlerException etc. as class based exceptions.
Stefan Vogel <sv@exept.de>
parents:
4513
diff
changeset
|
1535 |
"Modified: / 4.8.1999 / 08:42:12 / stefan" |
5985 | 1536 |
"Modified: / 7.9.2001 / 13:29:08 / cg" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1537 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1538 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1539 |
proceedWith:value |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1540 |
"Continue after the raise - the raise returns value" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1541 |
|
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1542 |
|con rCon| |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1543 |
|
6920
ff7892b5b41a
no longer raise ProceedError
Claus Gittinger <cg@exept.de>
parents:
6859
diff
changeset
|
1544 |
"/ proceedable ifFalse:[ |
ff7892b5b41a
no longer raise ProceedError
Claus Gittinger <cg@exept.de>
parents:
6859
diff
changeset
|
1545 |
"/ "proceed from ProceedError to recover from this error" |
ff7892b5b41a
no longer raise ProceedError
Claus Gittinger <cg@exept.de>
parents:
6859
diff
changeset
|
1546 |
"/ ProceedError raiseRequestWith:self. |
ff7892b5b41a
no longer raise ProceedError
Claus Gittinger <cg@exept.de>
parents:
6859
diff
changeset
|
1547 |
"/ proceedable := true. |
ff7892b5b41a
no longer raise ProceedError
Claus Gittinger <cg@exept.de>
parents:
6859
diff
changeset
|
1548 |
"/ ]. |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1549 |
|
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1550 |
|
4556 | 1551 |
thisContext evaluateUnwindActionsUpTo:suspendedContext. |
1552 |
||
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1553 |
con := suspendedContext. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1554 |
rCon := raiseContext. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1555 |
handlerContext := suspendedContext := raiseContext := nil. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1556 |
con resumeIgnoringErrors:value. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1557 |
|
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1558 |
"we arrive here, if suspendedContext is not resumable - |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1559 |
resume our raise context ... |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1560 |
... consider this a fallBack kludge, for the case that |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1561 |
a raising context is not returnable." |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1562 |
|
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1563 |
rCon return:value. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1564 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1565 |
"Modified: / 27.3.1997 / 16:45:57 / cg" |
4517
8c539600fb63
Implement NoHandlerException etc. as class based exceptions.
Stefan Vogel <sv@exept.de>
parents:
4513
diff
changeset
|
1566 |
"Modified: / 4.8.1999 / 08:42:17 / stefan" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1567 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1568 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1569 |
reject |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1570 |
"handler decided not to handle this signal - |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1571 |
system will look for another handler" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1572 |
|
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1573 |
|con| |
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1574 |
|
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1575 |
"find the last doCallXX: context" |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1576 |
con := Context findFirstSpecialHandle:false raise:true. |
8617 | 1577 |
[con notNil |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1578 |
and:[con receiver ~~ self]] whileTrue:[ |
8617 | 1579 |
con := con findSpecialHandle:false raise:true. |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1580 |
]. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1581 |
|
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1582 |
"returning form the doCallXX: signals a reject" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1583 |
rejected := true. |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1584 |
con unwind:nil. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1585 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1586 |
" |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
1587 |
Error handle:[:ex | |
8617 | 1588 |
'1' printCR. |
1589 |
ex reject |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1590 |
] do:[ |
17728
bbc5fa73dfab
Merged with trunk r10466
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17711
diff
changeset
|
1591 |
Error handle:[:ex | |
8617 | 1592 |
'2' printCR. |
1593 |
ex reject |
|
1594 |
] do:[ |
|
1595 |
#() at:1 |
|
1596 |
] |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1597 |
] |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1598 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1599 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1600 |
|
4556 | 1601 |
resignalAs:anotherException |
1602 |
"resignal anotherException, as if it was raised in the first place" |
|
1603 |
||
1604 |
|con| |
|
1605 |
||
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1606 |
con := self returnableSuspendedContext. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1607 |
handlerContext := suspendedContext := raiseContext := nil. |
6364
b7d1a52ec256
Workaround for non-returnable contexts in #resignalAs:
Stefan Vogel <sv@exept.de>
parents:
6264
diff
changeset
|
1608 |
con unwindThenDo:[anotherException raiseSignal]. |
4556 | 1609 |
|
1610 |
" |
|
6364
b7d1a52ec256
Workaround for non-returnable contexts in #resignalAs:
Stefan Vogel <sv@exept.de>
parents:
6264
diff
changeset
|
1611 |
|rslt| |
b7d1a52ec256
Workaround for non-returnable contexts in #resignalAs:
Stefan Vogel <sv@exept.de>
parents:
6264
diff
changeset
|
1612 |
|
7753 | 1613 |
ZeroDivide handle:[:ex | |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1614 |
ex resignalAs:DomainError |
6364
b7d1a52ec256
Workaround for non-returnable contexts in #resignalAs:
Stefan Vogel <sv@exept.de>
parents:
6264
diff
changeset
|
1615 |
] do:[ |
8617 | 1616 |
rslt := 5 // 0 |
6364
b7d1a52ec256
Workaround for non-returnable contexts in #resignalAs:
Stefan Vogel <sv@exept.de>
parents:
6264
diff
changeset
|
1617 |
]. |
b7d1a52ec256
Workaround for non-returnable contexts in #resignalAs:
Stefan Vogel <sv@exept.de>
parents:
6264
diff
changeset
|
1618 |
rslt |
b7d1a52ec256
Workaround for non-returnable contexts in #resignalAs:
Stefan Vogel <sv@exept.de>
parents:
6264
diff
changeset
|
1619 |
" |
b7d1a52ec256
Workaround for non-returnable contexts in #resignalAs:
Stefan Vogel <sv@exept.de>
parents:
6264
diff
changeset
|
1620 |
|
b7d1a52ec256
Workaround for non-returnable contexts in #resignalAs:
Stefan Vogel <sv@exept.de>
parents:
6264
diff
changeset
|
1621 |
" |
b7d1a52ec256
Workaround for non-returnable contexts in #resignalAs:
Stefan Vogel <sv@exept.de>
parents:
6264
diff
changeset
|
1622 |
|rslt| |
4556 | 1623 |
|
7753 | 1624 |
MessageNotUnderstood handle:[:ex | |
8617 | 1625 |
ex resignalAs:Number domainErrorSignal |
4556 | 1626 |
] do:[ |
8617 | 1627 |
rslt := 1 perform:#foo |
4556 | 1628 |
]. |
1629 |
rslt |
|
1630 |
" |
|
17732
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1631 |
|
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1632 |
" |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1633 |
|rslt firstTime| |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1634 |
|
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1635 |
firstTime := true. |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1636 |
ZeroDivide handle:[:ex | |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1637 |
firstTime ifTrue:[ |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1638 |
Dialog information:'again...'. |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1639 |
firstTime := false. |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1640 |
ex resignalAs:ZeroDivide. |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1641 |
]. |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1642 |
Dialog information:'arrived here again...'. |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1643 |
] do:[ |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1644 |
rslt := 5 // 0 |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1645 |
]. |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1646 |
rslt |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
1647 |
" |
4556 | 1648 |
! |
1649 |
||
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1650 |
restart |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1651 |
"restart the handle:do: - usually after some repair work is done |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1652 |
in the handler" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1653 |
|
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1654 |
|con| |
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1655 |
|
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1656 |
con := handlerContext. |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1657 |
handlerContext := suspendedContext := raiseContext := nil. |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1658 |
con unwindAndRestart |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1659 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1660 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1661 |
|rslt n| |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1662 |
|
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1663 |
Error handle:[:ex | |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1664 |
Transcript showCR:'fixing divisor ...'. |
8617 | 1665 |
n := 1. |
1666 |
ex restart. |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1667 |
] do:[ |
8617 | 1668 |
rslt := 5 / n. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1669 |
]. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1670 |
rslt |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1671 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1672 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1673 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1674 |
restartDo:aBlock |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1675 |
"restart the handle:do: but execute the argument, aBlock instead of the |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1676 |
original do-block - usually after some repair work is done in handler" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1677 |
|
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1678 |
|con| |
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1679 |
|
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1680 |
con := handlerContext. |
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1681 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1682 |
"/ handlerContext unwindThenDo:[ |
8617 | 1683 |
"/ handlerContext receiver |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1684 |
"/ handle:(handlerContext argAt:1) |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1685 |
"/ do:aBlock |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1686 |
"/ ]. |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1687 |
handlerContext := suspendedContext := raiseContext := nil. |
4544
2a0e3853d320
#returnDoing works for any exception handler.
Stefan Vogel <sv@exept.de>
parents:
4538
diff
changeset
|
1688 |
con receiver handlerProtectedBlock:aBlock inContext:con. |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1689 |
con unwindAndRestart |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1690 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1691 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1692 |
|sig rslt| |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1693 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1694 |
sig := Signal new. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1695 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1696 |
sig handle:[:ex | |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1697 |
Transcript showCR:'exchanging do-block ...'. |
8617 | 1698 |
ex restartDo:[ rslt := 999 ] |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1699 |
] do:[ |
8617 | 1700 |
rslt := 0. |
1701 |
sig raise |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1702 |
]. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1703 |
Transcript showCR:rslt |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1704 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1705 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1706 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1707 |
|sig rslt| |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1708 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1709 |
Object errorSignal handle:[:ex | |
8617 | 1710 |
ex restartDo:[ rslt := 999 ] |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1711 |
] do:[ |
8617 | 1712 |
rslt := nil foo. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1713 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1714 |
]. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1715 |
Transcript showCR:rslt |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1716 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1717 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1718 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1719 |
|sig rslt| |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1720 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1721 |
Object errorSignal handle:[:ex | |
8617 | 1722 |
ex restartDo:[ 'handler' printCR. rslt := nil foo ] |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1723 |
] do:[ |
8617 | 1724 |
rslt := nil foo. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1725 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1726 |
]. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1727 |
Transcript showCR:rslt |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1728 |
" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1729 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1730 |
"Modified: / 8.11.1997 / 18:52:28 / cg" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1731 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1732 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1733 |
resume |
11299 | 1734 |
"Continue after the raise - the raise returns defaultResumeValue - ANSI" |
1735 |
||
1736 |
self proceedWith:(self defaultResumeValue) |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1737 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1738 |
"Modified: / 2.3.1998 / 10:51:55 / stefan" |
5985 | 1739 |
"Modified: / 7.9.2001 / 13:28:34 / cg" |
1740 |
! |
|
1741 |
||
1742 |
resume:value |
|
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1743 |
"Continue after the raise - the raise returns value - ANSI" |
5985 | 1744 |
|
11299 | 1745 |
self proceedWith:value |
5985 | 1746 |
|
1747 |
"Modified: / 7.9.2001 / 13:28:49 / cg" |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1748 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1749 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1750 |
resumeWith:value |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1751 |
"Continue after the raise - the raise returns value - ANSI" |
8617 | 1752 |
|
11299 | 1753 |
self proceedWith:value |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1754 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1755 |
"Modified: / 2.3.1998 / 10:51:48 / stefan" |
5985 | 1756 |
"Modified: / 7.9.2001 / 13:29:26 / cg" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1757 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1758 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1759 |
return |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1760 |
"Continue after the handle:do: - the handle:do: returns nil" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1761 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1762 |
|con| |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1763 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1764 |
con := handlerContext. |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1765 |
handlerContext := suspendedContext := raiseContext := nil. |
5984
2d5c04c9fab6
ANSI; added #defaultResumeValue and #defaultReturnValue.
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
1766 |
con unwind:(self defaultReturnValue) |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1767 |
|
5985 | 1768 |
"Modified: / 7.9.2001 / 13:29:34 / cg" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1769 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1770 |
|
5939 | 1771 |
return:value |
1772 |
"Continue after the handle:do: - the handle:do: returns value" |
|
1773 |
||
1774 |
|con| |
|
1775 |
||
1776 |
con := handlerContext. |
|
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1777 |
handlerContext := suspendedContext := raiseContext := nil. |
5939 | 1778 |
con unwind:value |
1779 |
||
1780 |
"Modified: 27.3.1997 / 16:46:51 / cg" |
|
1781 |
! |
|
1782 |
||
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1783 |
returnDoing:aBlock |
4544
2a0e3853d320
#returnDoing works for any exception handler.
Stefan Vogel <sv@exept.de>
parents:
4538
diff
changeset
|
1784 |
"Continue after the handle:do: - the handle:do: returns aBlock value |
2a0e3853d320
#returnDoing works for any exception handler.
Stefan Vogel <sv@exept.de>
parents:
4538
diff
changeset
|
1785 |
Be careful when debugging. You cannot see the context with #returnDoing: |
2a0e3853d320
#returnDoing works for any exception handler.
Stefan Vogel <sv@exept.de>
parents:
4538
diff
changeset
|
1786 |
in the debugger if aBlock raises a signal" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1787 |
|
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1788 |
|con| |
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1789 |
|
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1790 |
con := handlerContext. |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1791 |
handlerContext := suspendedContext := raiseContext := nil. |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1792 |
con unwindThenDo:aBlock |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1793 |
|
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1794 |
" |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1795 |
[ |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1796 |
5 // 0 |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1797 |
] on:Error do:[:ex| |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1798 |
ex returnDoing:[self halt. 47*11]. |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1799 |
] |
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1800 |
" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1801 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1802 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1803 |
returnWith:value |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1804 |
"Continue after the handle:do: - the handle:do: returns value" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1805 |
|
5939 | 1806 |
self return:value |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1807 |
! ! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1808 |
|
5570 | 1809 |
!GenericException methodsFor:'printing & storing'! |
4562 | 1810 |
|
1811 |
description |
|
1812 |
"return the description string of the signal" |
|
1813 |
||
6248
1898c39ebdfa
care for non-string description
Claus Gittinger <cg@exept.de>
parents:
6246
diff
changeset
|
1814 |
|sigDescr| |
1898c39ebdfa
care for non-string description
Claus Gittinger <cg@exept.de>
parents:
6246
diff
changeset
|
1815 |
|
1898c39ebdfa
care for non-string description
Claus Gittinger <cg@exept.de>
parents:
6246
diff
changeset
|
1816 |
sigDescr := signal description. |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1817 |
(messageText isNil or:[ messageText isString not]) |
6248
1898c39ebdfa
care for non-string description
Claus Gittinger <cg@exept.de>
parents:
6246
diff
changeset
|
1818 |
ifTrue:[ |
8617 | 1819 |
^ sigDescr |
4562 | 1820 |
]. |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1821 |
(messageText startsWith:Character space) ifTrue:[ |
8617 | 1822 |
^ sigDescr, messageText. |
4562 | 1823 |
]. |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1824 |
(messageText endsWith:Character space) ifTrue:[ |
8617 | 1825 |
^ messageText, sigDescr. |
4562 | 1826 |
]. |
1827 |
||
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1828 |
^ messageText |
4562 | 1829 |
|
1830 |
" |
|
1831 |
(Error new messageText:'bla') description |
|
1832 |
(Error new messageText:' bla') description |
|
1833 |
(Error new messageText:'bla ') description |
|
1834 |
" |
|
1835 |
||
1836 |
"Modified: / 12.3.1998 / 15:13:28 / stefan" |
|
6859
5ef85865e8db
Print exception description with #printOn:
Stefan Vogel <sv@exept.de>
parents:
6630
diff
changeset
|
1837 |
! |
5ef85865e8db
Print exception description with #printOn:
Stefan Vogel <sv@exept.de>
parents:
6630
diff
changeset
|
1838 |
|
11234
65c3be6b0d72
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
11026
diff
changeset
|
1839 |
descriptionForDebugger |
65c3be6b0d72
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
11026
diff
changeset
|
1840 |
"return the description string of the signal which is used in the |
65c3be6b0d72
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
11026
diff
changeset
|
1841 |
debugger title area" |
65c3be6b0d72
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
11026
diff
changeset
|
1842 |
|
65c3be6b0d72
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
11026
diff
changeset
|
1843 |
^ self description. |
65c3be6b0d72
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
11026
diff
changeset
|
1844 |
! |
65c3be6b0d72
got rid of the \"unhandled...(\" prefix in the debugger;
Claus Gittinger <cg@exept.de>
parents:
11026
diff
changeset
|
1845 |
|
6859
5ef85865e8db
Print exception description with #printOn:
Stefan Vogel <sv@exept.de>
parents:
6630
diff
changeset
|
1846 |
printOn:aStream |
8941
4b4c238d0e7b
#printOn: and #printString now print the description (without "an Error())
Stefan Vogel <sv@exept.de>
parents:
8931
diff
changeset
|
1847 |
aStream nextPutAll:self description |
4562 | 1848 |
! ! |
1849 |
||
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1850 |
!GenericException methodsFor:'private'! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1851 |
|
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1852 |
doCallAction |
8617 | 1853 |
"call the action proper |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1854 |
- needed an extra method to have a raise-marked context around |
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1855 |
( see implementation of #reject and #proceed)." |
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1856 |
|
4488
db914d752859
must mark returned contexts as returnable
Claus Gittinger <cg@exept.de>
parents:
4484
diff
changeset
|
1857 |
<context: #return> |
db914d752859
must mark returned contexts as returnable
Claus Gittinger <cg@exept.de>
parents:
4484
diff
changeset
|
1858 |
<exception: #raise> |
db914d752859
must mark returned contexts as returnable
Claus Gittinger <cg@exept.de>
parents:
4484
diff
changeset
|
1859 |
|
4527 | 1860 |
^ self defaultAction |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1861 |
! |
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1862 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1863 |
doCallHandler:aHandlerBlock |
8617 | 1864 |
"call the handler proper |
8691
8b83b6cb00ac
Use #argumentCount instead of #numArgs in #doCallHandler: - it is implemented in Object
Stefan Vogel <sv@exept.de>
parents:
8684
diff
changeset
|
1865 |
- an extra method is needed to have a raise-marked context around. |
8b83b6cb00ac
Use #argumentCount instead of #numArgs in #doCallHandler: - it is implemented in Object
Stefan Vogel <sv@exept.de>
parents:
8684
diff
changeset
|
1866 |
(see implementation of #reject and #proceed)." |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1867 |
|
4488
db914d752859
must mark returned contexts as returnable
Claus Gittinger <cg@exept.de>
parents:
4484
diff
changeset
|
1868 |
<context: #return> |
db914d752859
must mark returned contexts as returnable
Claus Gittinger <cg@exept.de>
parents:
4484
diff
changeset
|
1869 |
<exception: #raise> |
db914d752859
must mark returned contexts as returnable
Claus Gittinger <cg@exept.de>
parents:
4484
diff
changeset
|
1870 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1871 |
|val| |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1872 |
|
8691
8b83b6cb00ac
Use #argumentCount instead of #numArgs in #doCallHandler: - it is implemented in Object
Stefan Vogel <sv@exept.de>
parents:
8684
diff
changeset
|
1873 |
aHandlerBlock argumentCount == 0 ifTrue:[ |
11640
2df4e81e1dbd
changed #handlerForSignal:context:originator:
Stefan Vogel <sv@exept.de>
parents:
11621
diff
changeset
|
1874 |
"0-arg handler or any object - not interested in the exception argument" |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1875 |
val := aHandlerBlock value |
6158
7fb96896ed4b
support 0-arg handler blocks
Claus Gittinger <cg@exept.de>
parents:
6036
diff
changeset
|
1876 |
] ifFalse:[ |
11640
2df4e81e1dbd
changed #handlerForSignal:context:originator:
Stefan Vogel <sv@exept.de>
parents:
11621
diff
changeset
|
1877 |
"1-arg handler - pass myself as exception argument" |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1878 |
val := aHandlerBlock value:self. |
6158
7fb96896ed4b
support 0-arg handler blocks
Claus Gittinger <cg@exept.de>
parents:
6036
diff
changeset
|
1879 |
]. |
7fb96896ed4b
support 0-arg handler blocks
Claus Gittinger <cg@exept.de>
parents:
6036
diff
changeset
|
1880 |
|
8691
8b83b6cb00ac
Use #argumentCount instead of #numArgs in #doCallHandler: - it is implemented in Object
Stefan Vogel <sv@exept.de>
parents:
8684
diff
changeset
|
1881 |
"handler fall through - is just like a #return:(aHandlerBlock value)" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1882 |
|
8691
8b83b6cb00ac
Use #argumentCount instead of #numArgs in #doCallHandler: - it is implemented in Object
Stefan Vogel <sv@exept.de>
parents:
8684
diff
changeset
|
1883 |
self return:val |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1884 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1885 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1886 |
doRaise |
8617 | 1887 |
"search through the context-calling chain for a handle-context |
1888 |
to the raising signal, a parent of it, or a SignalSet which includes |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1889 |
the raising signal. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1890 |
If found, ask the receiver for the handler and evaluate |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1891 |
it with the receiver exception as argument. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1892 |
If no handler is found, perform the default #action method. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1893 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1894 |
ATTENTION: the code below depends on being called by #raise or |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1895 |
#raiseRequest for proper operation (it skips the sending context)." |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1896 |
|
4488
db914d752859
must mark returned contexts as returnable
Claus Gittinger <cg@exept.de>
parents:
4484
diff
changeset
|
1897 |
<context: #return> |
db914d752859
must mark returned contexts as returnable
Claus Gittinger <cg@exept.de>
parents:
4484
diff
changeset
|
1898 |
|
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1899 |
|currentContext| |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1900 |
|
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1901 |
"is nil a valid originator? If so, we need an extra |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1902 |
instanceVariable to record the originator setting" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1903 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1904 |
originator isNil ifTrue:[ |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1905 |
originator := suspendedContext homeReceiver |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1906 |
]. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1907 |
|
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1908 |
signal isExceptionCreator ifFalse:[ |
11621 | 1909 |
"not an exception or Signal - there is something wrong here..." |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1910 |
GenericException raiseWith:signal errorString:'unexpected non-ExceptionCreator in calling context'. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1911 |
]. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1912 |
|
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1913 |
"now, start searching for a handler. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1914 |
Start search above the last active handler. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1915 |
Skip raise contexts. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1916 |
If nil, then there is no handler and we can directly proceed |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1917 |
to the unhandled code below." |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1918 |
|
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1919 |
currentContext := suspendedContext findExceptional. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1920 |
[currentContext notNil] whileTrue:[ |
8617 | 1921 |
(currentContext isRaiseContext) ifTrue:[ |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1922 |
|ex1 con1| |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1923 |
|
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1924 |
"skip all the contexts between the raise and the sender of #handle:do" |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1925 |
ex1 := currentContext receiver. "exception, that has been raised" |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1926 |
con1 := ex1 handlerContext. "the context of the #handle:do:" |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1927 |
|
8617 | 1928 |
con1 isNil ifTrue:[ |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1929 |
"the handlerContext is nil if an exception's default action is performed. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1930 |
Start search at the sending context. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1931 |
Maybe we should better treat a default action like a #handle:do: |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1932 |
at the outest level. But the DebugView currently can't handle this, |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1933 |
because it tries to raise e.g. AbortOperationRequest even if it has bee invoked |
8617 | 1934 |
by e.g. NoHandlerError" |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1935 |
|
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1936 |
(ex1 signal == signal) ifTrue:[ |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1937 |
"the same exception that has been cought by a default action is raised again. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1938 |
don't recurse" |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1939 |
^ self noHandler. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1940 |
]. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1941 |
] ifFalse:[ |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1942 |
"skip to the raised exception's handleContext" |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1943 |
currentContext := con1. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1944 |
]. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1945 |
ex1 := con1 := nil. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1946 |
] ifFalse:[ "currentContext is a handleContext" |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1947 |
|r handler| |
8617 | 1948 |
|
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1949 |
"ask the the receiver of the #handle:do: or #on:do: or whatever- message for the handler. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1950 |
nil is returned, if the signal is not accepted" |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1951 |
r := currentContext receiver. "receiver of #handle:do: or #on:do:" |
8617 | 1952 |
(r notNil and:[(handler := r handlerForSignal:signal |
1953 |
context:currentContext |
|
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1954 |
originator:originator) notNil] |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1955 |
) ifTrue:[ |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1956 |
"call the handler" |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1957 |
|
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1958 |
handlerContext := currentContext. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1959 |
currentContext := nil. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1960 |
self doCallHandler:handler. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1961 |
|
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1962 |
"if the handler rejects, we arrive here |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1963 |
continue search for another handler" |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1964 |
currentContext := handlerContext. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1965 |
handler := handlerContext := nil. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1966 |
]. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1967 |
r := handler := nil. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1968 |
]. |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1969 |
currentContext notNil ifTrue:[ |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1970 |
currentContext := currentContext findSpecialHandle:true raise:true. "search starts at currentContext sender" |
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
1971 |
]. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1972 |
]. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1973 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1974 |
" |
8617 | 1975 |
we arrive here, if either no handler was found, |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1976 |
or every handler rejected. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1977 |
" |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1978 |
^ self doCallAction |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1979 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1980 |
"Created: / 12.5.1996 / 15:09:39 / cg" |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1981 |
"Modified: / 9.11.1997 / 14:48:44 / cg" |
4504 | 1982 |
"Modified: / 3.8.1999 / 11:20:41 / stefan" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1983 |
! ! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1984 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1985 |
!GenericException methodsFor:'raising'! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1986 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1987 |
raise |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
1988 |
"actually raise a non-proceedable exception" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1989 |
|
4556 | 1990 |
<context: #return> |
1991 |
||
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1992 |
raiseContext := thisContext. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1993 |
suspendedContext isNil ifTrue:[ |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
1994 |
suspendedContext := raiseContext sender |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1995 |
]. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1996 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1997 |
proceedable := false. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1998 |
^ self doRaise |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
1999 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2000 |
"Modified: / 12.5.1996 / 15:09:47 / cg" |
4507 | 2001 |
"Modified: / 3.8.1999 / 13:33:01 / stefan" |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2002 |
! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2003 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2004 |
raiseRequest |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2005 |
"actually raise a proceedable exception." |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2006 |
|
4556 | 2007 |
<context: #return> |
2008 |
||
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
2009 |
raiseContext := thisContext. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2010 |
suspendedContext isNil ifTrue:[ |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
2011 |
suspendedContext := raiseContext sender |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2012 |
]. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2013 |
|
8617 | 2014 |
self mayProceed ifFalse:[ |
2015 |
StrictRaising ifTrue:[ |
|
2016 |
"/ proceeding from wrongProceedabilitySignal grants the raiseRequest |
|
2017 |
WrongProceedabilityError raiseRequestWith:signal |
|
2018 |
] ifFalse:[ |
|
10737
de05d84da87d
error message (wrong proceedability)
Claus Gittinger <cg@exept.de>
parents:
10389
diff
changeset
|
2019 |
self class name infoPrint. |
17780 | 2020 |
' [warning]: raised with wrong proceedability' infoPrintCR. |
8617 | 2021 |
] |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2022 |
]. |
4484
9476c82921d0
eliminated proceedBlock and rejectBlock;
Claus Gittinger <cg@exept.de>
parents:
4483
diff
changeset
|
2023 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2024 |
proceedable := true. |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2025 |
^ self doRaise |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2026 |
|
10737
de05d84da87d
error message (wrong proceedability)
Claus Gittinger <cg@exept.de>
parents:
10389
diff
changeset
|
2027 |
"Modified: / 04-08-1999 / 08:05:12 / stefan" |
17780 | 2028 |
"Modified: / 10-07-2010 / 19:48:42 / cg" |
5680 | 2029 |
! |
2030 |
||
8774
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2031 |
raiseRequestWith:aParameter errorString:aString |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2032 |
"raise the signal proceedable. |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2033 |
The argument, aString is used as messageText, |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2034 |
aParameter is passed as exception parameter." |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2035 |
|
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2036 |
<context: #return> |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2037 |
|
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2038 |
^ (self |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2039 |
suspendedContext:thisContext sender parameter:aParameter errorString:aString) |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2040 |
raiseRequest. |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2041 |
"Created: / 23.7.1999 / 14:08:57 / stefan" |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2042 |
! |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2043 |
|
5680 | 2044 |
raiseSignal |
2045 |
"actually raise an exception (whatever the proceedability is)." |
|
2046 |
||
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2047 |
<context: #return> |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2048 |
|
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
2049 |
raiseContext := thisContext. |
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2050 |
suspendedContext isNil ifTrue:[ |
9992
0774694cf9b3
- Add raiseContext as instance variable for faster #resume
Stefan Vogel <sv@exept.de>
parents:
9505
diff
changeset
|
2051 |
suspendedContext := raiseContext sender |
5680 | 2052 |
]. |
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2053 |
proceedable := self mayProceed. |
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2054 |
^ self doRaise |
8774
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2055 |
! |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2056 |
|
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2057 |
raiseWith:aParameter errorString:aString |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2058 |
"raise the signal nonproceedable. |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2059 |
The argument, aString is used as messageText, |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2060 |
aParameter is passed as exception parameter." |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2061 |
|
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2062 |
<context: #return> |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2063 |
|
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2064 |
^ (self |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2065 |
suspendedContext:thisContext sender parameter:aParameter errorString:aString) |
2bb732840713
+raiseWith / raiseRequestWith
Claus Gittinger <cg@exept.de>
parents:
8733
diff
changeset
|
2066 |
raise. |
5697
ce78c7d9ddbd
raiseSignal / raiseSignal: / raiseSignal:with:
Claus Gittinger <cg@exept.de>
parents:
5684
diff
changeset
|
2067 |
! ! |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2068 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2069 |
!GenericException methodsFor:'setup'! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2070 |
|
6945
9536335d243b
use setSignal, to avoid conflict with dolphin signals
Claus Gittinger <cg@exept.de>
parents:
6920
diff
changeset
|
2071 |
setSignal:aSignal |
9536335d243b
use setSignal, to avoid conflict with dolphin signals
Claus Gittinger <cg@exept.de>
parents:
6920
diff
changeset
|
2072 |
"set the fields usable for inspection by the handler |
9536335d243b
use setSignal, to avoid conflict with dolphin signals
Claus Gittinger <cg@exept.de>
parents:
6920
diff
changeset
|
2073 |
- only to be sent from the signal when raising. |
9536335d243b
use setSignal, to avoid conflict with dolphin signals
Claus Gittinger <cg@exept.de>
parents:
6920
diff
changeset
|
2074 |
CG: added this one to avoid confusion with dolphin signal: (which raises the ex)" |
9536335d243b
use setSignal, to avoid conflict with dolphin signals
Claus Gittinger <cg@exept.de>
parents:
6920
diff
changeset
|
2075 |
|
9536335d243b
use setSignal, to avoid conflict with dolphin signals
Claus Gittinger <cg@exept.de>
parents:
6920
diff
changeset
|
2076 |
signal := aSignal. |
9536335d243b
use setSignal, to avoid conflict with dolphin signals
Claus Gittinger <cg@exept.de>
parents:
6920
diff
changeset
|
2077 |
! |
9536335d243b
use setSignal, to avoid conflict with dolphin signals
Claus Gittinger <cg@exept.de>
parents:
6920
diff
changeset
|
2078 |
|
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2079 |
suspendedContext:sContext errorString:aString |
8617 | 2080 |
"set required fields |
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2081 |
- only to be sent from the signal when raising" |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2082 |
|
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
2083 |
messageText := aString. |
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2084 |
suspendedContext := sContext. |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2085 |
! |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2086 |
|
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2087 |
suspendedContext:aContext messageText:aString parameter:aParameter originator:anOriginator |
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2088 |
suspendedContext := aContext. |
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2089 |
messageText := aString. |
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2090 |
parameter := aParameter. |
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2091 |
originator := anOriginator. |
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2092 |
! |
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2093 |
|
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2094 |
suspendedContext:sContext parameter:aParameter |
8617 | 2095 |
"set required fields |
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2096 |
- only to be sent from the signal when raising" |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2097 |
|
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2098 |
parameter := aParameter. |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2099 |
suspendedContext := sContext. |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2100 |
! |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2101 |
|
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2102 |
suspendedContext:sContext parameter:aParameter errorString:aString |
8617 | 2103 |
"set required fields |
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2104 |
- only to be sent from the signal when raising" |
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2105 |
|
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2106 |
parameter := aParameter. |
8313
2aa626e8e404
Fix do not execute an exception handler inside the do-block, when the
Stefan Vogel <sv@exept.de>
parents:
8254
diff
changeset
|
2107 |
messageText := aString. |
6430
9a1580465dd2
better impl. of #deferAfter:
Claus Gittinger <cg@exept.de>
parents:
6426
diff
changeset
|
2108 |
suspendedContext := sContext. |
8684
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2109 |
! |
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2110 |
|
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2111 |
suspendedContext:aContext parameter:aParameter originator:anOriginator |
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2112 |
suspendedContext := aContext. |
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2113 |
parameter := aParameter. |
9c00854305f7
QuerySignal generates Notifications instead of Exceptions.
Stefan Vogel <sv@exept.de>
parents:
8681
diff
changeset
|
2114 |
originator := anOriginator. |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2115 |
! ! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2116 |
|
6220 | 2117 |
!GenericException methodsFor:'testing'! |
2118 |
||
8065
23355398af34
isOpenError, isStreamError and isError queries added
Claus Gittinger <cg@exept.de>
parents:
7808
diff
changeset
|
2119 |
isError |
23355398af34
isOpenError, isStreamError and isError queries added
Claus Gittinger <cg@exept.de>
parents:
7808
diff
changeset
|
2120 |
^ false |
23355398af34
isOpenError, isStreamError and isError queries added
Claus Gittinger <cg@exept.de>
parents:
7808
diff
changeset
|
2121 |
! |
23355398af34
isOpenError, isStreamError and isError queries added
Claus Gittinger <cg@exept.de>
parents:
7808
diff
changeset
|
2122 |
|
6220 | 2123 |
isException |
2124 |
^ true |
|
2125 |
||
2126 |
"Created: / 17.11.2001 / 18:37:27 / cg" |
|
8681
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
2127 |
! |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
2128 |
|
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
2129 |
isNotification |
38aa963476a5
Support for Block>>#on:do:on:do:
Stefan Vogel <sv@exept.de>
parents:
8677
diff
changeset
|
2130 |
^ false |
6220 | 2131 |
! ! |
2132 |
||
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2133 |
!GenericException class methodsFor:'documentation'! |
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2134 |
|
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2135 |
version |
17780 | 2136 |
^ '$Id: GenericException.st 10544 2010-07-12 16:20:36Z vranyj1 $' |
17732
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
2137 |
! |
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
2138 |
|
a1892eeca6c0
trunk merged into jv branch
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17728
diff
changeset
|
2139 |
version_CVS |
17780 | 2140 |
^ 'Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.125 2010/07/10 17:49:23 cg Exp ' |
17761
b0e5971141bc
Added Lookup and BuiltinLookup classes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17736
diff
changeset
|
2141 |
! |
b0e5971141bc
Added Lookup and BuiltinLookup classes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17736
diff
changeset
|
2142 |
|
b0e5971141bc
Added Lookup and BuiltinLookup classes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17736
diff
changeset
|
2143 |
version_SVN |
17780 | 2144 |
^ '$Id: GenericException.st 10544 2010-07-12 16:20:36Z vranyj1 $' |
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2145 |
! ! |
6859
5ef85865e8db
Print exception description with #printOn:
Stefan Vogel <sv@exept.de>
parents:
6630
diff
changeset
|
2146 |
|
4481
f3f7e1af7489
added GenericException in-between, to allow for some exceptions
Claus Gittinger <cg@exept.de>
parents:
diff
changeset
|
2147 |
GenericException initialize! |
17767 | 2148 |
|
17772
6e0b3c06c364
Method reverted to r10532
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17767
diff
changeset
|
2149 |
|
17780 | 2150 |