Skip to content
Snippets Groups Projects
Commit 405c1bb4 authored by sof's avatar sof
Browse files

[project @ 1998-08-14 13:06:56 by sof]

Better error messages
parent 1a8ef592
No related branches found
No related tags found
No related merge requests found
...@@ -46,7 +46,7 @@ getGroupEntryForID gid = ...@@ -46,7 +46,7 @@ getGroupEntryForID gid =
_ccall_ getgrgid gid >>= \ ptr -> _ccall_ getgrgid gid >>= \ ptr ->
if ptr == (``NULL'' :: Addr) then if ptr == (``NULL'' :: Addr) then
fail (IOError Nothing NoSuchThing fail (IOError Nothing NoSuchThing
"getGroupEntryForID: no such group entry") "getGroupEntryForID" "no such group entry")
else else
unpackGroupEntry ptr unpackGroupEntry ptr
...@@ -56,7 +56,7 @@ getGroupEntryForName name = ...@@ -56,7 +56,7 @@ getGroupEntryForName name =
_ccall_ getgrnam gname >>= \ ptr -> _ccall_ getgrnam gname >>= \ ptr ->
if ptr == (``NULL'' :: Addr) then if ptr == (``NULL'' :: Addr) then
fail (IOError Nothing NoSuchThing fail (IOError Nothing NoSuchThing
"getGroupEntryForName: no such group entry") "getGroupEntryForName" "no such group entry")
else else
unpackGroupEntry ptr unpackGroupEntry ptr
...@@ -65,7 +65,7 @@ getUserEntryForID uid = ...@@ -65,7 +65,7 @@ getUserEntryForID uid =
_ccall_ getpwuid uid >>= \ ptr -> _ccall_ getpwuid uid >>= \ ptr ->
if ptr == ``NULL'' then if ptr == ``NULL'' then
fail (IOError Nothing NoSuchThing fail (IOError Nothing NoSuchThing
"getUserEntryForID: no such user entry") "getUserEntryForID" "no such user entry")
else else
unpackUserEntry ptr unpackUserEntry ptr
...@@ -75,7 +75,7 @@ getUserEntryForName name = ...@@ -75,7 +75,7 @@ getUserEntryForName name =
_ccall_ getpwnam uname >>= \ ptr -> _ccall_ getpwnam uname >>= \ ptr ->
if ptr == ``NULL'' then if ptr == ``NULL'' then
fail (IOError Nothing NoSuchThing fail (IOError Nothing NoSuchThing
"getUserEntryForName: no such user entry") "getUserEntryForName" "no such user entry")
else else
unpackUserEntry ptr unpackUserEntry ptr
\end{code} \end{code}
......
...@@ -128,7 +128,7 @@ readDirStream dirp = do ...@@ -128,7 +128,7 @@ readDirStream dirp = do
else do else do
errno <- getErrorCode errno <- getErrorCode
if errno == noError if errno == noError
then fail (IOError Nothing EOF "EOF") then fail (IOError Nothing EOF "readDirStream" "EOF")
else syserr "readDirStream" else syserr "readDirStream"
rewindDirStream :: DirStream -> IO () rewindDirStream :: DirStream -> IO ()
...@@ -529,7 +529,7 @@ pathconf n name = do ...@@ -529,7 +529,7 @@ pathconf n name = do
else do else do
errno <- getErrorCode errno <- getErrorCode
if errno == invalidArgument if errno == invalidArgument
then fail (IOError Nothing NoSuchThing "PosixFiles.getPathVar: no such path limit or option") then fail (IOError Nothing NoSuchThing "getPathVar" "no such path limit or option")
else syserr "PosixFiles.getPathVar" else syserr "PosixFiles.getPathVar"
...@@ -553,7 +553,7 @@ fpathconf n fd = do ...@@ -553,7 +553,7 @@ fpathconf n fd = do
else do else do
errno <- getErrorCode errno <- getErrorCode
if errno == invalidArgument if errno == invalidArgument
then fail (IOError Nothing NoSuchThing "getFileVar: no such path limit or option") then fail (IOError Nothing NoSuchThing "getFileVar" "no such path limit or option")
else syserr "getFileVar" else syserr "getFileVar"
\end{code} \end{code}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment