Handle openErrorSignal in preparition for change openErrorSignal
authorStefan Vogel <sv@exept.de>
Sun, 02 Mar 2003 19:39:45 +0100
changeset 1710 ad35e6a18e98
parent 1709 fc33be8aaa9c
child 1711 b3ba13167ee7
Handle openErrorSignal in preparition for change openErrorSignal to be a real exception (this is currently a Notification)
XBMReader.st
XPMReader.st
--- a/XBMReader.st	Sun Mar 02 19:34:01 2003 +0100
+++ b/XBMReader.st	Sun Mar 02 19:39:45 2003 +0100
@@ -301,8 +301,9 @@
             errorString:('XBM format does not support an imageMask').
     ].
 
-    outStream := FileStream newFileNamed:aFileName.
-    outStream isNil ifTrue:[
+    [
+        outStream := aFileName asFilename newReadWriteStream.
+    ] on:FileStream openErrorSignal do:[:ex|
         ^ Image fileCreationErrorSignal 
             raiseWith:image
             errorString:('file creation error: ' , aFileName asString).
@@ -364,6 +365,7 @@
 !XBMReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/XBMReader.st,v 1.45 2001-10-16 11:25:48 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/XBMReader.st,v 1.46 2003-03-02 18:39:33 stefan Exp $'
 ! !
+
 XBMReader initialize!
--- a/XPMReader.st	Sun Mar 02 19:34:01 2003 +0100
+++ b/XPMReader.st	Sun Mar 02 19:39:45 2003 +0100
@@ -507,8 +507,9 @@
         nChars := 2.
     ].
 
-    outStream := FileStream newFileNamed:aFileName.
-    outStream isNil ifTrue:[
+    [
+        outStream := aFileName asFilename newReadWriteStream.
+    ] on:FileStream openErrorSignal do:[:ex|
         ^ Image fileCreationErrorSignal 
             raiseWith:image
             errorString:('file creation error: ' , aFileName asString).
@@ -572,7 +573,7 @@
 !XPMReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/XPMReader.st,v 1.48 2002-10-25 18:27:20 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/XPMReader.st,v 1.49 2003-03-02 18:39:45 stefan Exp $'
 ! !
 
 XPMReader initialize!