author | Claus Gittinger <cg@exept.de> |
Thu, 27 Jun 2019 16:34:40 +0200 | |
changeset 24379 | 852be153b0ec |
parent 16562 | de9b98f4a494 |
child 18120 | e3a375d5f6a8 |
permissions | -rw-r--r-- |
7586 | 1 |
" |
2 |
COPYRIGHT (c) 2001 by eXept Software AG |
|
16562 | 3 |
All Rights Reserved |
7586 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
5990 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
14 |
ProceedableError subclass:#StreamError |
|
15498 | 15 |
instanceVariableNames:'errorCode osErrorHolder' |
5990 | 16 |
classVariableNames:'' |
17 |
poolDictionaries:'' |
|
6210
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5990
diff
changeset
|
18 |
category:'Kernel-Exceptions-Errors' |
5990 | 19 |
! |
20 |
||
6210
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5990
diff
changeset
|
21 |
!StreamError class methodsFor:'documentation'! |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5990
diff
changeset
|
22 |
|
7586 | 23 |
copyright |
24 |
" |
|
25 |
COPYRIGHT (c) 2001 by eXept Software AG |
|
16562 | 26 |
All Rights Reserved |
7586 | 27 |
|
28 |
This software is furnished under a license and may be used |
|
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
36 |
||
6210
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5990
diff
changeset
|
37 |
documentation |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5990
diff
changeset
|
38 |
" |
7232 | 39 |
The parent of all stream errors. |
6210
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5990
diff
changeset
|
40 |
" |
d7039e2ae776
caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents:
5990
diff
changeset
|
41 |
! ! |
5990 | 42 |
|
12685 | 43 |
!StreamError methodsFor:'accessing'! |
44 |
||
15572 | 45 |
errorCategory |
46 |
"return the generi OS independent error category. |
|
47 |
return #unknown, if this is not an OS error" |
|
48 |
||
49 |
|holder| |
|
50 |
||
51 |
holder := self osErrorHolder. |
|
52 |
holder isNil ifTrue:[ |
|
16562 | 53 |
^ #unknown |
15572 | 54 |
]. |
55 |
^ holder errorCategory. |
|
56 |
! |
|
57 |
||
12685 | 58 |
errorCode |
59 |
^ errorCode |
|
60 |
! |
|
61 |
||
62 |
errorCode:something |
|
63 |
errorCode := something. |
|
15498 | 64 |
! |
65 |
||
66 |
osErrorHolder |
|
67 |
"return the error holder describing an OS error. |
|
68 |
return nil, if this is not an OS error" |
|
69 |
||
70 |
(osErrorHolder isNil and:[errorCode isInteger]) ifTrue:[ |
|
16562 | 71 |
osErrorHolder := OperatingSystem errorHolderForNumber:errorCode. |
15498 | 72 |
]. |
73 |
^ osErrorHolder. |
|
74 |
! |
|
75 |
||
76 |
osErrorHolder:something |
|
77 |
osErrorHolder := something. |
|
12685 | 78 |
! ! |
79 |
||
15843 | 80 |
!StreamError methodsFor:'printing & storing'! |
81 |
||
82 |
description |
|
16562 | 83 |
"lazy initialization - the text is not needed for caught exceptions" |
15843 | 84 |
|
85 |
messageText isNil ifTrue:[ |
|
16562 | 86 |
self initializeMessageText |
15843 | 87 |
]. |
88 |
^ super description |
|
89 |
! |
|
90 |
||
91 |
initializeMessageText |
|
16562 | 92 |
"for lazy initialization - the text is not needed for caught exceptions" |
15843 | 93 |
|
94 |
osErrorHolder notNil ifTrue:[ |
|
16562 | 95 |
messageText := (' : ' , osErrorHolder errorString) |
15843 | 96 |
]. |
97 |
! |
|
98 |
||
99 |
messageText |
|
16562 | 100 |
"lazy initialization - the text is not needed for caught exceptions" |
15843 | 101 |
|
102 |
messageText isNil ifTrue:[ |
|
16562 | 103 |
self initializeMessageText |
15843 | 104 |
]. |
105 |
^ messageText |
|
106 |
! ! |
|
107 |
||
5990 | 108 |
!StreamError class methodsFor:'documentation'! |
109 |
||
110 |
version |
|
16562 | 111 |
^ '$Header: /cvs/stx/stx/libbasic/StreamError.st,v 1.11 2014-06-10 10:20:23 cg Exp $' |
12685 | 112 |
! |
113 |
||
114 |
version_CVS |
|
16562 | 115 |
^ '$Header: /cvs/stx/stx/libbasic/StreamError.st,v 1.11 2014-06-10 10:20:23 cg Exp $' |
5990 | 116 |
! ! |