Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Server.hs #2

Merged
merged 2 commits into from Aug 19, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Network/FTP/Server.hs
Expand Up @@ -83,9 +83,9 @@ import Network.FTP.Server.Parser
import Network.FTP.Client.Parser
import Network.BSD
import Network.Socket
import qualified Network
--import qualified Network
import System.IO.Utils
import System.IO.Error
--import System.IO.Error
import System.Log.Logger
import Network.Utils
import Network.SocketServer
Expand All @@ -98,7 +98,7 @@ import Text.Printf
import Data.Char
import Data.IORef
import Data.List
import Control.Exception(finally)
import Control.Exception (try, catch, finally, SomeException)
import System.IO

data DataType = ASCII | Binary
Expand Down Expand Up @@ -168,8 +168,8 @@ trapIOError :: FTPServer -> IO a -> (a -> IO Bool) -> IO Bool
trapIOError h testAction remainingAction =
do result <- try testAction
case result of
Left err -> do sendReply h 550 (show err)
return True
Left (err::SomeException) -> do sendReply h 550 (show err)
return True
Right result -> remainingAction result

forceLogin :: CommandHandler -> CommandHandler
Expand Down Expand Up @@ -211,7 +211,7 @@ commands =
commandLoop :: FTPServer -> IO ()
commandLoop h@(FTPServer fh _ _) =
let errorhandler e = do noticeM logname
("Closing due to error: " ++ (show e))
("Closing due to error: " ++ (show (e::SomeException)))
hClose fh
return False
in do continue <- (flip catch) errorhandler
Expand Down