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