StreamError.st
author convert-repo
Wed, 10 Jul 2013 13:09:28 +0000
changeset 15507 48222edbd770
parent 15498 e6e60ed6dd3d
child 15572 72b82922f0f2
child 18075 bd252c0beac9
permissions -rw-r--r--
update tags
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7586
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
     1
"
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
     2
 COPYRIGHT (c) 2001 by eXept Software AG
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
     3
              All Rights Reserved
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
     4
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
     5
 This software is furnished under a license and may be used
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
     6
 only in accordance with the terms of that license and with the
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
     8
 be provided or otherwise made available to, or used by, any
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
     9
 other person.  No title to or ownership of the software is
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    10
 hereby transferred.
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    11
"
5990
41458048a33f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libbasic' }"
41458048a33f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
41458048a33f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
ProceedableError subclass:#StreamError
15498
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    15
	instanceVariableNames:'errorCode osErrorHolder'
5990
41458048a33f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
41458048a33f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
6210
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5990
diff changeset
    18
	category:'Kernel-Exceptions-Errors'
5990
41458048a33f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
41458048a33f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    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
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    23
copyright
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    24
"
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    25
 COPYRIGHT (c) 2001 by eXept Software AG
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    26
              All Rights Reserved
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    27
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    28
 This software is furnished under a license and may be used
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    29
 only in accordance with the terms of that license and with the
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    31
 be provided or otherwise made available to, or used by, any
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    32
 other person.  No title to or ownership of the software is
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    33
 hereby transferred.
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    34
"
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    35
!
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7232
diff changeset
    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
1d05a293b8b0 comments
Claus Gittinger <cg@exept.de>
parents: 6210
diff changeset
    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
41458048a33f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
12685
c3b1ec066773 add instvar: errorCode
Stefan Vogel <sv@exept.de>
parents: 8509
diff changeset
    43
!StreamError methodsFor:'accessing'!
c3b1ec066773 add instvar: errorCode
Stefan Vogel <sv@exept.de>
parents: 8509
diff changeset
    44
c3b1ec066773 add instvar: errorCode
Stefan Vogel <sv@exept.de>
parents: 8509
diff changeset
    45
errorCode
c3b1ec066773 add instvar: errorCode
Stefan Vogel <sv@exept.de>
parents: 8509
diff changeset
    46
    ^ errorCode
c3b1ec066773 add instvar: errorCode
Stefan Vogel <sv@exept.de>
parents: 8509
diff changeset
    47
!
c3b1ec066773 add instvar: errorCode
Stefan Vogel <sv@exept.de>
parents: 8509
diff changeset
    48
c3b1ec066773 add instvar: errorCode
Stefan Vogel <sv@exept.de>
parents: 8509
diff changeset
    49
errorCode:something
c3b1ec066773 add instvar: errorCode
Stefan Vogel <sv@exept.de>
parents: 8509
diff changeset
    50
    errorCode := something.
15498
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    51
!
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    52
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    53
osErrorHolder
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    54
    "return the error holder describing an OS error.
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    55
     return nil, if this is not an OS error"
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    56
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    57
    (osErrorHolder isNil and:[errorCode isInteger]) ifTrue:[
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    58
        osErrorHolder := OperatingSystem errorHolderForNumber:errorCode.
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    59
    ].
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    60
    ^ osErrorHolder.
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    61
!
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    62
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    63
osErrorHolder:something
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    64
    osErrorHolder := something.
12685
c3b1ec066773 add instvar: errorCode
Stefan Vogel <sv@exept.de>
parents: 8509
diff changeset
    65
! !
c3b1ec066773 add instvar: errorCode
Stefan Vogel <sv@exept.de>
parents: 8509
diff changeset
    66
5990
41458048a33f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
!StreamError class methodsFor:'documentation'!
41458048a33f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
41458048a33f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
version
15498
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    70
    ^ '$Header: /cvs/stx/stx/libbasic/StreamError.st,v 1.8 2013-07-09 11:57:15 stefan Exp $'
12685
c3b1ec066773 add instvar: errorCode
Stefan Vogel <sv@exept.de>
parents: 8509
diff changeset
    71
!
c3b1ec066773 add instvar: errorCode
Stefan Vogel <sv@exept.de>
parents: 8509
diff changeset
    72
c3b1ec066773 add instvar: errorCode
Stefan Vogel <sv@exept.de>
parents: 8509
diff changeset
    73
version_CVS
15498
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    74
    ^ '$Header: /cvs/stx/stx/libbasic/StreamError.st,v 1.8 2013-07-09 11:57:15 stefan Exp $'
5990
41458048a33f initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
! !
15498
e6e60ed6dd3d class: StreamError
Stefan Vogel <sv@exept.de>
parents: 12685
diff changeset
    76