Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 64 lines (55 sloc) 3.164 kb
4d98d36d »
2010-12-26 flag -fglasgow-exts is deprecated
1 {-# LANGUAGE DeriveDataTypeable #-}
2
a1730ad8 »
2008-08-31 Switch to using Cabal's CLI API
3 module Error (HackPortError(..), throwEx, catchEx, hackPortShowError) where
29a2daa9 »
2005-09-11 GPG support and code beautification for HackPort
4
5 import Data.Typeable
f9f401a9 »
2009-12-20 moved from OldException to extensible-exceptions
6 import Control.Exception.Extensible as EE
a1730ad8 »
2008-08-31 Switch to using Cabal's CLI API
7 import Control.Monad.Error
29a2daa9 »
2005-09-11 GPG support and code beautification for HackPort
8
9 data HackPortError
4cfa22ea »
2005-10-02 Changing program layout to a monadic state transformer
10 = ArgumentError String
11 | ConnectionFailed String String
7d1091ea »
2007-08-29 Change parameter to merge and remove --portage-category
12 | PackageNotFound String
29a2daa9 »
2005-09-11 GPG support and code beautification for HackPort
13 | InvalidTarballURL String String
14 | InvalidSignatureURL String String
15 | VerificationFailed String String
16 | DownloadFailed String String
17 | UnknownCompression String
18 | UnpackingFailed String Int
19 | NoCabalFound String
20 | ExtractionFailed String String Int
21 | CabalParseFailed String String
54702b5d »
2005-09-21 Added support for overlay-guessing
22 | BashNotFound
23 | BashError String
24 | NoOverlay
25 | MultipleOverlays [String]
980982ab »
2005-09-21 Adding support for different verbosity-levels
26 | UnknownVerbosityLevel String
63b57b89 »
2007-07-28 Adapted HackPort to the new Hackage interface
27 -- | WrongCacheVersion
28 -- | InvalidCache
29 | InvalidServer String
f9f401a9 »
2009-12-20 moved from OldException to extensible-exceptions
30 deriving (Typeable, Show)
29a2daa9 »
2005-09-11 GPG support and code beautification for HackPort
31
a1730ad8 »
2008-08-31 Switch to using Cabal's CLI API
32 instance Error HackPortError where
33
f9f401a9 »
2009-12-20 moved from OldException to extensible-exceptions
34 instance Exception HackPortError where
35
a1730ad8 »
2008-08-31 Switch to using Cabal's CLI API
36 throwEx :: HackPortError -> IO a
f9f401a9 »
2009-12-20 moved from OldException to extensible-exceptions
37 throwEx = EE.throw
4cfa22ea »
2005-10-02 Changing program layout to a monadic state transformer
38
a1730ad8 »
2008-08-31 Switch to using Cabal's CLI API
39 catchEx :: IO a -> (HackPortError -> IO a) -> IO a
f9f401a9 »
2009-12-20 moved from OldException to extensible-exceptions
40 catchEx = EE.catch
29a2daa9 »
2005-09-11 GPG support and code beautification for HackPort
41
4cfa22ea »
2005-10-02 Changing program layout to a monadic state transformer
42 hackPortShowError :: HackPortError -> String
43 hackPortShowError err = case err of
290e0609 »
2005-10-23 Improved hackport's diff mode
44 ArgumentError str -> "Argument error: "++str
4cfa22ea »
2005-10-02 Changing program layout to a monadic state transformer
45 ConnectionFailed server reason -> "Connection to hackage server '"++server++"' failed: "++reason
3921baba »
2009-02-19 Improve error message
46 PackageNotFound pkg -> "Package '"++ pkg ++"' not found on server. Try 'hackport update'?"
29a2daa9 »
2005-09-11 GPG support and code beautification for HackPort
47 InvalidTarballURL url reason -> "Error while downloading tarball '"++url++"': "++reason
48 InvalidSignatureURL url reason -> "Error while downloading signature '"++url++"': "++reason
49 VerificationFailed file signature -> "Error while checking signature('"++signature++"') of '"++file++"'"
50 DownloadFailed url reason -> "Error while downloading '"++url++"': "++reason
51 UnknownCompression tarball -> "Couldn't guess compression type of '"++tarball++"'"
52 UnpackingFailed tarball code -> "Unpacking '"++tarball++"' failed with exit code '"++show code++"'"
53 NoCabalFound tarball -> "Tarball '"++tarball++"' doesn't contain a cabal file"
54 ExtractionFailed tarball file code -> "Extracting '"++file++"' from '"++tarball++"' failed with '"++show code++"'"
55 CabalParseFailed file reason -> "Error while parsing cabal file '"++file++"': "++reason
54702b5d »
2005-09-21 Added support for overlay-guessing
56 BashNotFound -> "The 'bash' executable was not found. It is required to figure out your portage-overlay. If you don't want to install bash, use '-p path-to-overlay'"
57 BashError str -> "Error while guessing your portage-overlay. Either set PORTDIR_OVERLAY in /etc/make.conf or use '-p path-to-overlay'.\nThe error was: \""++str++"\""
58 MultipleOverlays overlays -> "You have the following overlays available: '"++unwords overlays++"'. Please choose one by using '-p path-to-overlay'"
59 NoOverlay -> "You don't have PORTDIR_OVERLAY set in '/etc/make.conf'. Please set it or use '-p path-to-overlay'"
980982ab »
2005-09-21 Adding support for different verbosity-levels
60 UnknownVerbosityLevel str -> "The verbosity level '"++str++"' is invalid. Please use debug,normal or silent"
87d875b3 »
2008-03-15 Wall police
61 InvalidServer srv -> "Invalid server address, could not parse: " ++ srv
63b57b89 »
2007-07-28 Adapted HackPort to the new Hackage interface
62 --WrongCacheVersion -> "The version of the cache is too old. Please update the cache using 'hackport update'"
63 --InvalidCache -> "Could not read the cache. Please ensure that it's up to date using 'hackport update'"
Something went wrong with that request. Please try again.