Permalink
Browse files

moved from OldException to extensible-exceptions

  • Loading branch information...
1 parent 1585cc6 commit f9f401a9abcac71149448e4831e33fade31a9657 @trofi trofi committed Dec 20, 2009
Showing with 12 additions and 11 deletions.
  1. +6 −5 Error.hs
  2. +6 −6 hackport.cabal
View
@@ -2,8 +2,7 @@
module Error (HackPortError(..), throwEx, catchEx, hackPortShowError) where
import Data.Typeable
-import Control.Exception
-
+import Control.Exception.Extensible as EE
import Control.Monad.Error
data HackPortError
@@ -27,15 +26,17 @@ data HackPortError
-- | WrongCacheVersion
-- | InvalidCache
| InvalidServer String
- deriving (Typeable)
+ deriving (Typeable, Show)
instance Error HackPortError where
+instance Exception HackPortError where
+
throwEx :: HackPortError -> IO a
-throwEx = throwDyn
+throwEx = EE.throw
catchEx :: IO a -> (HackPortError -> IO a) -> IO a
-catchEx = catchDyn
+catchEx = EE.catch
hackPortShowError :: HackPortError -> String
hackPortShowError err = case err of
View
@@ -16,7 +16,7 @@ Executable hackport
Main-Is: Main.hs
Hs-Source-Dirs: ., cabal-install-0.8.0
Build-Depends:
- base >= 2.0 && < 4,
+ base >= 2.0 && < 5,
filepath,
parsec,
mtl,
@@ -27,21 +27,21 @@ Executable hackport
HTTP >= 4000.0.3,
zlib,
tar,
- array
+ array,
-- array is inherited from cabal-install
-
- -- tar >= 0.3.0.0 && < 0.4
+ -- tar >= 0.3.0.0 && < 0.4
+ extensible-exceptions
if flag(split-base)
Build-Depends:
- base >= 3 && < 4,
+ base >= 3 && < 5,
directory,
containers,
process,
old-time,
bytestring
else
- Build-Depends: base < 3
+ Build-Depends: base < 3
ghc-options: -Wall
other-modules:

0 comments on commit f9f401a

Please sign in to comment.