StreamError.st
changeset 16562 de9b98f4a494
parent 15843 94dce19d82df
child 18120 e3a375d5f6a8
equal deleted inserted replaced
16561:58b6d00013c4 16562:de9b98f4a494
     1 "
     1 "
     2  COPYRIGHT (c) 2001 by eXept Software AG
     2  COPYRIGHT (c) 2001 by eXept Software AG
     3               All Rights Reserved
     3 	      All Rights Reserved
     4 
     4 
     5  This software is furnished under a license and may be used
     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
     6  only in accordance with the terms of that license and with the
     7  inclusion of the above copyright notice.   This software may not
     7  inclusion of the above copyright notice.   This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
    21 !StreamError class methodsFor:'documentation'!
    21 !StreamError class methodsFor:'documentation'!
    22 
    22 
    23 copyright
    23 copyright
    24 "
    24 "
    25  COPYRIGHT (c) 2001 by eXept Software AG
    25  COPYRIGHT (c) 2001 by eXept Software AG
    26               All Rights Reserved
    26 	      All Rights Reserved
    27 
    27 
    28  This software is furnished under a license and may be used
    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
    29  only in accordance with the terms of that license and with the
    30  inclusion of the above copyright notice.   This software may not
    30  inclusion of the above copyright notice.   This software may not
    31  be provided or otherwise made available to, or used by, any
    31  be provided or otherwise made available to, or used by, any
    48 
    48 
    49     |holder|
    49     |holder|
    50 
    50 
    51     holder := self osErrorHolder.
    51     holder := self osErrorHolder.
    52     holder isNil ifTrue:[
    52     holder isNil ifTrue:[
    53         ^ #unknown
    53 	^ #unknown
    54     ].
    54     ].
    55     ^ holder errorCategory.
    55     ^ holder errorCategory.
    56 !
    56 !
    57 
    57 
    58 errorCode
    58 errorCode
    66 osErrorHolder
    66 osErrorHolder
    67     "return the error holder describing an OS error.
    67     "return the error holder describing an OS error.
    68      return nil, if this is not an OS error"
    68      return nil, if this is not an OS error"
    69 
    69 
    70     (osErrorHolder isNil and:[errorCode isInteger]) ifTrue:[
    70     (osErrorHolder isNil and:[errorCode isInteger]) ifTrue:[
    71         osErrorHolder := OperatingSystem errorHolderForNumber:errorCode.
    71 	osErrorHolder := OperatingSystem errorHolderForNumber:errorCode.
    72     ].
    72     ].
    73     ^ osErrorHolder.
    73     ^ osErrorHolder.
    74 !
    74 !
    75 
    75 
    76 osErrorHolder:something
    76 osErrorHolder:something
    78 ! !
    78 ! !
    79 
    79 
    80 !StreamError methodsFor:'printing & storing'!
    80 !StreamError methodsFor:'printing & storing'!
    81 
    81 
    82 description
    82 description
    83     "lazy initialization - the text is not needed for cought exceptions"
    83     "lazy initialization - the text is not needed for caught exceptions"
    84 
    84 
    85     messageText isNil ifTrue:[
    85     messageText isNil ifTrue:[
    86         self initializeMessageText
    86 	self initializeMessageText
    87     ].
    87     ].
    88     ^ super description
    88     ^ super description
    89 !
    89 !
    90 
    90 
    91 initializeMessageText
    91 initializeMessageText
    92     "for lazy initialization - the text is not needed for cought exceptions"
    92     "for lazy initialization - the text is not needed for caught exceptions"
    93 
    93 
    94     osErrorHolder notNil ifTrue:[
    94     osErrorHolder notNil ifTrue:[
    95         messageText := (' : ' , osErrorHolder errorString)
    95 	messageText := (' : ' , osErrorHolder errorString)
    96     ].
    96     ].
    97 !
    97 !
    98 
    98 
    99 messageText
    99 messageText
   100     "lazy initialization - the text is not needed for cought exceptions"
   100     "lazy initialization - the text is not needed for caught exceptions"
   101 
   101 
   102     messageText isNil ifTrue:[
   102     messageText isNil ifTrue:[
   103         self initializeMessageText
   103 	self initializeMessageText
   104     ].
   104     ].
   105     ^ messageText
   105     ^ messageText
   106 ! !
   106 ! !
   107 
   107 
   108 !StreamError class methodsFor:'documentation'!
   108 !StreamError class methodsFor:'documentation'!
   109 
   109 
   110 version
   110 version
   111     ^ '$Header: /cvs/stx/stx/libbasic/StreamError.st,v 1.10 2013-12-04 11:23:00 stefan Exp $'
   111     ^ '$Header: /cvs/stx/stx/libbasic/StreamError.st,v 1.11 2014-06-10 10:20:23 cg Exp $'
   112 !
   112 !
   113 
   113 
   114 version_CVS
   114 version_CVS
   115     ^ '$Header: /cvs/stx/stx/libbasic/StreamError.st,v 1.10 2013-12-04 11:23:00 stefan Exp $'
   115     ^ '$Header: /cvs/stx/stx/libbasic/StreamError.st,v 1.11 2014-06-10 10:20:23 cg Exp $'
   116 ! !
   116 ! !
   117