*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Tue, 11 Dec 2001 15:22:09 +0100
changeset 6270 077fe1f763c8
parent 6269 3a888523e3a6
child 6271 2b5b7674ec44
*** empty log message ***
OSErrorHolder.nst
OSErrorHolder.st
OsError.st
OsIllegalOperation.st
OsInaccessibleError.st
OsInvalidArgumentsError.st
OsNeedRetryError.st
OsNoResourcesError.st
OsNotification.st
OsTransferFaultError.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OSErrorHolder.nst	Tue Dec 11 15:22:09 2001 +0100
@@ -0,0 +1,206 @@
+"
+ COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
+	      All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+
+
+
+'From Smalltalk/X, Version:4.1.4 on 11-dec-2001 at 02:52:35 pm'                 !
+
+"{ Package: 'stx:libbasic' }"
+
+Object subclass:#OSErrorHolder
+	instanceVariableNames:'errorSymbol errorCategory errorMessage'
+	classVariableNames:'Signals OSErrorSignal'
+	poolDictionaries:''
+	category:'OS-Support'
+!
+
+!OSErrorHolder class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
+	      All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+
+
+!
+
+documentation
+"
+    This class represents low level operating system errors.
+    We do not use error numbers, because there may be different errnos
+    for the same error on different systems.
+
+    [instance variables:]
+        errorSymbol             symbol associated with this error
+        errorCategory           symbol defining the error category.
+                                This is in fact a symbol that returns a
+                                Signal when sent to myself.
+
+        While the errorSymbol may be different on different platforms,
+        the errorCategories (which refer to the Signals that will be raised) 
+        are identical.
+        You can get an OS independent error message for an error by sending
+        #errorCategoryString.
+
+    [author:]
+        Stefan Vogel
+
+    [see also:]
+        OperatingSystem
+"
+! !
+
+!OSErrorHolder class methodsFor:'accessing'!
+
+errorSignal
+    ^ OperatingSystem errorSignal
+
+    "Created: 25.1.1997 / 18:07:55 / cg"
+!
+
+invalidArgumentsSignal
+    ^ OperatingSystem invalidArgumentsSignal
+
+    "Created: 13.9.1997 / 10:48:21 / cg"
+!
+
+peerFaultSignal
+    ^ OperatingSystem errorSignal
+
+    "Created: 25.1.1997 / 18:07:55 / cg"
+! !
+
+!OSErrorHolder class methodsFor:'class initialization'!
+
+initialize
+    "init signals etc."
+
+    |s|
+
+    OSErrorSignal isNil ifTrue:[
+        OSErrorSignal := Error newSignalMayProceed:true.
+        OSErrorSignal nameClass:self message:#errorSignal.
+        OSErrorSignal notifierString:'OperatingSystem error'.
+
+
+        Signals := Dictionary new:28.
+
+        "/ Information signals
+
+        s := self setupSignal:#informationSignal parent:OSErrorSignal 
+                     notifier:'Information'.
+        self setupSignal:#operationStartedSignal parent:s 
+                     notifier:'Operation started'.
+
+        "/ Retry signals
+
+        s := self setupSignal:#needRetrySignal parent:OSErrorSignal 
+                     notifier:'Retry Operation'.
+        self setupSignal:#notReadySignal parent:s 
+                     notifier:' -- referent not ready'.
+        self setupSignal:#transientErrorSignal parent:s 
+                     notifier:' -- transient error'.
+        self setupSignal:#allocRetrySignal parent:s 
+                     notifier:' -- allocation failure'.
+
+        "/ Resource signals
+
+        s := self setupSignal:#noResourcesSignal parent:OSErrorSignal 
+                     notifier:'Not enough resources'.
+        self setupSignal:#noMemorySignal parent:s 
+                     notifier:' -- memory'.
+
+        "/ Transfer faults
+
+        s := self setupSignal:#transferFaultSignal parent:OSErrorSignal 
+                     notifier:'Transfer fault'.
+        self setupSignal:#noDataSignal parent:s 
+                     notifier:'Data unavailable/EOF reached'.
+        self setupSignal:#peerFaultSignal parent:s 
+                     notifier:'Communication with peer failed'.
+        self setupSignal:#volumeFullSignal parent:s 
+                     notifier:'Volume full'.
+
+        "/ Inaccesible faults
+
+        s := self setupSignal:#inaccessibleSignal parent:OSErrorSignal 
+                     notifier:'Referent inaccessible'.
+        self setupSignal:#nonExistantSignal parent:s 
+                     notifier:'File does not exist'.
+        self setupSignal:#unavailableReferentSignal parent:s 
+                     notifier:' currently'.
+        self setupSignal:#noPermissionsSignal parent:s 
+                     notifier:'Permission denied'.
+        self setupSignal:#existingReferentSignal parent:s 
+                     notifier:' -- already exists or currently in use'.
+        self setupSignal:#inappropriateReferentSignal parent:s 
+                     notifier:' -- operation inappropriate'.
+
+        "/ Illegal operations
+
+        s := self setupSignal:#illegalOperationSignal parent:OSErrorSignal 
+                     notifier:'Illegal Operation'.
+        self setupSignal:#inappropriateOperationSignal parent:s 
+                     notifier:'Inappropriate operation'.
+        self setupSignal:#wrongSubtypeForOperationSignal parent:s 
+                     notifier:' -- wrong subtype'.
+        self setupSignal:#unsupportedOperationSignal parent:s 
+                     notifier:' -- on this platform'.
+        self setupSignal:#unpreparedOperationSignal parent:s 
+                     notifier:' -- wrong sequence'.
+
+        "/ Illegal arguments
+
+        s := self setupSignal:#invalidArgumentsSignal parent:OSErrorSignal 
+                     notifier:'Invalid Arguments'.
+        self setupSignal:#badArgumentsSignal parent:s 
+                     notifier:' -- wrong class'.
+        self setupSignal:#badAccessorSignal parent:s 
+                     notifier:' -- accessor invalid'.
+        self setupSignal:#rangeErrorSignal parent:s 
+                     notifier:' -- out of range'.
+        self setupSignal:#underSpecifiedSignal parent:s 
+                     notifier:' -- operation not fully specified'.
+   ].
+
+
+   "
+    OSErrorSignal := nil.
+    self initialize
+   "
+! !
+
+!OSErrorHolder methodsFor:'accessing'!
+
+errorSymbol:sym errorCategory:typ errorMessage:text
+    errorSymbol := sym.
+    errorCategory := typ.
+    errorMessage := text
+! !
+
+!OSErrorHolder methodsFor:'others'!
+
+errorString ^'foo'
+!
+
+errorSymbol ^#foo
+! !
+
+OSErrorHolder initialize!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OSErrorHolder.st	Tue Dec 11 15:22:09 2001 +0100
@@ -0,0 +1,101 @@
+"
+ COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
+	      All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+
+
+
+'From Smalltalk/X, Version:4.1.4 on 11-dec-2001 at 02:22:13 pm'                 !
+
+Object subclass:#OSErrorHolder
+	instanceVariableNames:'errorSymbol errorCategory errorMessage'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'System-Support'
+!
+
+!OSErrorHolder class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 1997 by eXept Software AG / Claus Gittinger
+	      All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+
+
+!
+
+documentation
+"
+    ST-80 compatibility class.
+    This may be required when existing code has to be ported to ST/X;
+    however, it may not be complete and more protocol may be added in the future.
+    The code here was created when public domain code (Manchester) had to
+    be ported to ST/X and missing classes/methods were encountered, and code added
+    by reasoning 'what the original class could probably do there'.
+
+    This is an additional goody class; therefore:
+
+    THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTOR ``AS IS'' AND
+    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+    ARE DISCLAIMED.  IN NO EVENT SHALL THE CONTRIBUTOR BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+    SUCH DAMAGE.
+"
+
+
+! !
+
+!OSErrorHolder class methodsFor:'accessing'!
+
+errorSignal
+    ^ OperatingSystem errorSignal
+
+    "Created: 25.1.1997 / 18:07:55 / cg"
+!
+
+invalidArgumentsSignal
+    ^ OperatingSystem invalidArgumentsSignal
+
+    "Created: 13.9.1997 / 10:48:21 / cg"
+!
+
+peerFaultSignal
+    ^ OperatingSystem errorSignal
+
+    "Created: 25.1.1997 / 18:07:55 / cg"
+! !
+
+!OSErrorHolder methodsFor:'accessing'!
+
+errorSymbol:sym errorCategory:typ errorMessage:text
+    errorSymbol := sym.
+    errorCategory := typ.
+    errorMessage := text
+! !
+
+!OSErrorHolder class methodsFor:'documentation'!
+
+version
+    ^ '$Header: /cvs/stx/stx/libbasic/OSErrorHolder.st,v 1.1 2001-12-11 14:22:09 cg Exp $'
+! !
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OsError.st	Tue Dec 11 15:22:09 2001 +0100
@@ -0,0 +1,17 @@
+'From Smalltalk/X, Version:4.1.4 on 11-dec-2001 at 02:52:58 pm'                 !
+
+"{ Package: '__NoProject__' }"
+
+Error subclass:#OsError
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'OS-Support'
+!
+
+!OsError class methodsFor:'queries'!
+
+mayProceed
+    ^ true
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OsIllegalOperation.st	Tue Dec 11 15:22:09 2001 +0100
@@ -0,0 +1,11 @@
+'From Smalltalk/X, Version:4.1.4 on 11-dec-2001 at 02:53:01 pm'                 !
+
+"{ Package: '__NoProject__' }"
+
+OsError subclass:#OsIllegalOperation
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'OS-Support'
+!
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OsInaccessibleError.st	Tue Dec 11 15:22:09 2001 +0100
@@ -0,0 +1,11 @@
+'From Smalltalk/X, Version:4.1.4 on 11-dec-2001 at 02:53:04 pm'                 !
+
+"{ Package: '__NoProject__' }"
+
+OsError subclass:#OsInaccessibleError
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'OS-Support'
+!
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OsInvalidArgumentsError.st	Tue Dec 11 15:22:09 2001 +0100
@@ -0,0 +1,11 @@
+'From Smalltalk/X, Version:4.1.4 on 11-dec-2001 at 02:53:07 pm'                 !
+
+"{ Package: '__NoProject__' }"
+
+OsError subclass:#OsInvalidArgumentsError
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'OS-Support'
+!
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OsNeedRetryError.st	Tue Dec 11 15:22:09 2001 +0100
@@ -0,0 +1,11 @@
+'From Smalltalk/X, Version:4.1.4 on 11-dec-2001 at 02:53:09 pm'                 !
+
+"{ Package: '__NoProject__' }"
+
+OsError subclass:#OsNeedRetryError
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'OS-Support'
+!
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OsNoResourcesError.st	Tue Dec 11 15:22:09 2001 +0100
@@ -0,0 +1,11 @@
+'From Smalltalk/X, Version:4.1.4 on 11-dec-2001 at 02:53:12 pm'                 !
+
+"{ Package: '__NoProject__' }"
+
+OsError subclass:#OsNoResourcesError
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'OS-Support'
+!
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OsNotification.st	Tue Dec 11 15:22:09 2001 +0100
@@ -0,0 +1,11 @@
+'From Smalltalk/X, Version:4.1.4 on 11-dec-2001 at 02:53:14 pm'                 !
+
+"{ Package: '__NoProject__' }"
+
+OsError subclass:#OsNotification
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'OS-Support'
+!
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OsTransferFaultError.st	Tue Dec 11 15:22:09 2001 +0100
@@ -0,0 +1,11 @@
+'From Smalltalk/X, Version:4.1.4 on 11-dec-2001 at 02:53:16 pm'                 !
+
+"{ Package: '__NoProject__' }"
+
+OsError subclass:#OsTransferFaultError
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'OS-Support'
+!
+