Permalink
Browse files

Merge pull request #2 from mvv/throw-fix

Use throwIO instead of throw to raise SSL exceptions.
  • Loading branch information...
2 parents bf99870 + 959fe8b commit a69d88ea1ec7c9dee0bc508ca07f723f78d668c8 @depressed-pho committed Sep 18, 2011
Showing with 7 additions and 7 deletions.
  1. +7 −7 OpenSSL/Session.hsc
View
@@ -332,13 +332,13 @@ foreign import ccall "SSL_connect" _ssl_connect :: Ptr SSL_ -> IO CInt
foreign import ccall unsafe "SSL_get_error" _ssl_get_error :: Ptr SSL_ -> CInt -> IO CInt
throwSSLException :: CInt -> IO a
-throwSSLException (#const SSL_ERROR_ZERO_RETURN ) = throw ConnectionCleanlyClosed
-throwSSLException (#const SSL_ERROR_WANT_CONNECT ) = throw WantConnect
-throwSSLException (#const SSL_ERROR_WANT_ACCEPT ) = throw WantAccept
-throwSSLException (#const SSL_ERROR_WANT_X509_LOOKUP) = throw WantX509Lookup
-throwSSLException (#const SSL_ERROR_SYSCALL ) = throw SSLIOError
-throwSSLException (#const SSL_ERROR_SSL ) = throw ProtocolError
-throwSSLException x = throw (UnknownError (fromIntegral x))
+throwSSLException (#const SSL_ERROR_ZERO_RETURN ) = throwIO ConnectionCleanlyClosed
+throwSSLException (#const SSL_ERROR_WANT_CONNECT ) = throwIO WantConnect
+throwSSLException (#const SSL_ERROR_WANT_ACCEPT ) = throwIO WantAccept
+throwSSLException (#const SSL_ERROR_WANT_X509_LOOKUP) = throwIO WantX509Lookup
+throwSSLException (#const SSL_ERROR_SYSCALL ) = throwIO SSLIOError
+throwSSLException (#const SSL_ERROR_SSL ) = throwIO ProtocolError
+throwSSLException x = throwIO (UnknownError (fromIntegral x))
-- | This is the type of an SSL IO operation. EOF and termination are handled
-- by exceptions while everything else is one of these. Note that reading

0 comments on commit a69d88e

Please sign in to comment.