#REFACTORING by stefan
authorStefan Vogel <sv@exept.de>
Fri, 25 Nov 2016 14:52:50 +0100
changeset 21047 de1173d83b1f
parent 21046 4aca308b3427
child 21048 65bba70cab00
#REFACTORING by stefan class: OsError added:5 methods access methods for OSErrorHolder parameter
OsError.st
--- a/OsError.st	Fri Nov 25 14:51:55 2016 +0100
+++ b/OsError.st	Fri Nov 25 14:52:50 2016 +0100
@@ -9,8 +9,9 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 "
+"{ Package: 'stx:libbasic' }"
 
-"{ Package: 'stx:libbasic' }"
+"{ NameSpace: Smalltalk }"
 
 Error subclass:#OsError
 	instanceVariableNames:''
@@ -35,14 +36,71 @@
 "
 ! !
 
+!OsError class methodsFor:'initialization'!
+
+initialize
+    NotifierString := 'OperatingSystem error'.
+! !
+
 !OsError class methodsFor:'queries'!
 
 mayProceed
     ^ true
 ! !
 
+!OsError methodsFor:'accessing'!
+
+description
+
+    "parameter is an OSErrorHolder, if present"
+    parameter notNil ifTrue:[
+        ^ parameter description.
+    ].
+    ^ super description.
+
+    "
+      [  
+        (OperatingSystem errorHolderForNumber:22)
+             parameter:'bla';
+             reportError.
+      ] on:OsError do:[:ex|
+            ex description inspect.
+      ].
+    "
+!
+
+errorCategory
+
+    "parameter is an OSErrorHolder, if present"
+    parameter notNil ifTrue:[
+        ^ parameter errorCategory.
+    ].
+    ^ ''.
+!
+
+errorString
+
+    "parameter is an OSErrorHolder, if present"
+    parameter notNil ifTrue:[
+        ^ parameter errorString.
+    ].
+    ^ ''.
+!
+
+errorSymbol
+
+    "parameter is an OSErrorHolder, if present"
+    parameter notNil ifTrue:[
+        ^ parameter errorSymbol.
+    ].
+    ^ ''.
+! !
+
 !OsError class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/OsError.st,v 1.3 2003-08-30 12:31:08 cg Exp $'
+    ^ '$Header$'
 ! !
+
+
+OsError initialize!