Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 56 lines (50 sloc) 2.9 kb
29a2daa GPG support and code beautification for HackPort
der_eq@freenet.de authored
1 {-# OPTIONS -fglasgow-exts #-}
2 module Error where
3
4 import Data.Typeable
87d875b @kolmodin Wall police
kolmodin authored
5 import Control.Monad.Error (Error)
29a2daa GPG support and code beautification for HackPort
der_eq@freenet.de authored
6
7 data HackPortError
4cfa22e Changing program layout to a monadic state transformer
der_eq@freenet.de authored
8 = ArgumentError String
9 | ConnectionFailed String String
7d1091e @kolmodin Change parameter to merge and remove --portage-category
kolmodin authored
10 | PackageNotFound String
29a2daa GPG support and code beautification for HackPort
der_eq@freenet.de authored
11 | InvalidTarballURL String String
12 | InvalidSignatureURL String String
13 | VerificationFailed String String
14 | DownloadFailed String String
15 | UnknownCompression String
16 | UnpackingFailed String Int
17 | NoCabalFound String
18 | ExtractionFailed String String Int
19 | CabalParseFailed String String
54702b5 Added support for overlay-guessing
der_eq@freenet.de authored
20 | BashNotFound
21 | BashError String
22 | NoOverlay
23 | MultipleOverlays [String]
980982a Adding support for different verbosity-levels
der_eq@freenet.de authored
24 | UnknownVerbosityLevel String
63b57b8 Adapted HackPort to the new Hackage interface
der_eq@freenet.de authored
25 -- | WrongCacheVersion
26 -- | InvalidCache
27 | InvalidServer String
29a2daa GPG support and code beautification for HackPort
der_eq@freenet.de authored
28 deriving (Typeable)
29
4cfa22e Changing program layout to a monadic state transformer
der_eq@freenet.de authored
30 instance Error HackPortError
31
29a2daa GPG support and code beautification for HackPort
der_eq@freenet.de authored
32 type HackPortResult a = Either
33
4cfa22e Changing program layout to a monadic state transformer
der_eq@freenet.de authored
34 hackPortShowError :: HackPortError -> String
35 hackPortShowError err = case err of
290e060 Improved hackport's diff mode
der_eq@freenet.de authored
36 ArgumentError str -> "Argument error: "++str
4cfa22e Changing program layout to a monadic state transformer
der_eq@freenet.de authored
37 ConnectionFailed server reason -> "Connection to hackage server '"++server++"' failed: "++reason
7d1091e @kolmodin Change parameter to merge and remove --portage-category
kolmodin authored
38 PackageNotFound pkg -> "Package '"++ pkg ++"' not found on server."
29a2daa GPG support and code beautification for HackPort
der_eq@freenet.de authored
39 InvalidTarballURL url reason -> "Error while downloading tarball '"++url++"': "++reason
40 InvalidSignatureURL url reason -> "Error while downloading signature '"++url++"': "++reason
41 VerificationFailed file signature -> "Error while checking signature('"++signature++"') of '"++file++"'"
42 DownloadFailed url reason -> "Error while downloading '"++url++"': "++reason
43 UnknownCompression tarball -> "Couldn't guess compression type of '"++tarball++"'"
44 UnpackingFailed tarball code -> "Unpacking '"++tarball++"' failed with exit code '"++show code++"'"
45 NoCabalFound tarball -> "Tarball '"++tarball++"' doesn't contain a cabal file"
46 ExtractionFailed tarball file code -> "Extracting '"++file++"' from '"++tarball++"' failed with '"++show code++"'"
47 CabalParseFailed file reason -> "Error while parsing cabal file '"++file++"': "++reason
54702b5 Added support for overlay-guessing
der_eq@freenet.de authored
48 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'"
49 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++"\""
50 MultipleOverlays overlays -> "You have the following overlays available: '"++unwords overlays++"'. Please choose one by using '-p path-to-overlay'"
51 NoOverlay -> "You don't have PORTDIR_OVERLAY set in '/etc/make.conf'. Please set it or use '-p path-to-overlay'"
980982a Adding support for different verbosity-levels
der_eq@freenet.de authored
52 UnknownVerbosityLevel str -> "The verbosity level '"++str++"' is invalid. Please use debug,normal or silent"
87d875b @kolmodin Wall police
kolmodin authored
53 InvalidServer srv -> "Invalid server address, could not parse: " ++ srv
63b57b8 Adapted HackPort to the new Hackage interface
der_eq@freenet.de authored
54 --WrongCacheVersion -> "The version of the cache is too old. Please update the cache using 'hackport update'"
55 --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.