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