Skip to content

Commit b745f99

Browse files
committed
Fixing stringError to errorString
1 parent 7e04c8e commit b745f99

11 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/Stack/Build.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ queryBuildInfo selectors0 =
411411
_ -> err $ "Cannot apply selector to " ++ show value
412412
where
413413
cont = select (front . (sel:)) sels
414-
err msg = stringError $ msg ++ ": " ++ show (front [sel])
414+
err msg = errorString $ msg ++ ": " ++ show (front [sel])
415415

416416
-- | Get the raw build information object
417417
rawBuildInfo :: (StackM env m, HasEnvConfig env) => m Value

src/Stack/Config.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,10 @@ makeConcreteResolver ar = do
202202
ARLatestNightly -> return $ ResolverSnapshot $ Nightly $ snapshotsNightly snapshots
203203
ARLatestLTSMajor x ->
204204
case IntMap.lookup x $ snapshotsLts snapshots of
205-
Nothing -> stringError $ "No LTS release found with major version " ++ show x
205+
Nothing -> errorString $ "No LTS release found with major version " ++ show x
206206
Just y -> return $ ResolverSnapshot $ LTS x y
207207
ARLatestLTS
208-
| IntMap.null $ snapshotsLts snapshots -> stringError "No LTS releases found"
208+
| IntMap.null $ snapshotsLts snapshots -> errorString "No LTS releases found"
209209
| otherwise ->
210210
let (x, y) = IntMap.findMax $ snapshotsLts snapshots
211211
in return $ ResolverSnapshot $ LTS x y

src/Stack/Config/Nix.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ nixCompiler compilerVersion =
6161
(fixMinor (versionText v)))
6262
in case compilerVersion of
6363
GhcVersion v -> nixCompilerFromVersion v
64-
_ -> stringError "Only GHC is supported by stack --nix"
64+
_ -> errorString "Only GHC is supported by stack --nix"
6565

6666
-- Exceptions thown specifically by Stack.Nix
6767
data StackNixException

src/Stack/ConfigCmd.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ cfgCmdSet go cmd = do
7070
case mstackYaml of
7171
LCSProject stackYaml -> return stackYaml
7272
LCSNoProject -> liftM (</> stackDotYaml) (getImplicitGlobalProjectDir conf)
73-
LCSNoConfig -> stringError "config command used when no local configuration available"
73+
LCSNoConfig -> errorString "config command used when no local configuration available"
7474
CommandScopeGlobal -> return (configUserConfigPath conf))
7575
-- We don't need to worry about checking for a valid yaml here
7676
(config :: Yaml.Object) <-
@@ -96,7 +96,7 @@ cfgCmdSetValue (ConfigCmdSetResolver newResolver) = do
9696
ResolverSnapshot snapName -> void $ loadMiniBuildPlan snapName
9797
ResolverCompiler _ -> return ()
9898
-- TODO: custom snapshot support? Would need a way to specify on CLI
99-
ResolverCustom _ _ -> stringError "'stack config set resolver' does not support custom resolvers"
99+
ResolverCustom _ _ -> errorString "'stack config set resolver' does not support custom resolvers"
100100
return (Yaml.String (resolverName concreteResolver))
101101
cfgCmdSetValue (ConfigCmdSetSystemGhc _ bool) =
102102
return (Yaml.Bool bool)

src/Stack/Init.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ getSnapshots' = do
328328
$logError " http://docs.haskellstack.org/en/stable/yaml_configuration/"
329329
$logError ""
330330
$logError $ "Exception was: " <> T.pack (show e)
331-
stringError ""
331+
errorString ""
332332

333333
-- | Get the default resolver value
334334
getDefaultResolver

src/Stack/PackageIndex.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ updateIndexHackageSecurity
301301
updateIndexHackageSecurity indexName' url (HackageSecurity keyIds threshold) = do
302302
baseURI <-
303303
case parseURI $ T.unpack url of
304-
Nothing -> stringError $ "Invalid Hackage Security base URL: " ++ T.unpack url
304+
Nothing -> errorString $ "Invalid Hackage Security base URL: " ++ T.unpack url
305305
Just x -> return x
306306
manager <- liftIO getGlobalManager
307307
root <- configPackageIndexRoot indexName'

src/Stack/Setup.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,13 +1695,13 @@ preferredPlatforms = do
16951695
Cabal.Windows -> return (True, "windows")
16961696
Cabal.OSX -> return (False, "osx")
16971697
Cabal.FreeBSD -> return (False, "freebsd")
1698-
_ -> stringError $ "Binary upgrade not yet supported on OS: " ++ show os'
1698+
_ -> errorString $ "Binary upgrade not yet supported on OS: " ++ show os'
16991699
arch <-
17001700
case arch' of
17011701
I386 -> return "i386"
17021702
X86_64 -> return "x86_64"
17031703
Arm -> return "arm"
1704-
_ -> stringError $ "Binary upgrade not yet supported on arch: " ++ show arch'
1704+
_ -> errorString $ "Binary upgrade not yet supported on arch: " ++ show arch'
17051705
hasgmp4 <- return False -- FIXME import relevant code from Stack.Setup? checkLib $(mkRelFile "libgmp.so.3")
17061706
let suffixes
17071707
| hasgmp4 = ["-static", "-gmp4", ""]

src/Stack/Types/FlagName.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ flagNameParser =
9494
mkFlagName :: String -> Q Exp
9595
mkFlagName s =
9696
case parseFlagNameFromString s of
97-
Nothing -> stringError ("Invalid flag name: " ++ show s)
97+
Nothing -> errorString ("Invalid flag name: " ++ show s)
9898
Just pn -> [|pn|]
9999

100100
-- | Convenient way to parse a flag name from a 'Text'.

src/Stack/Types/PackageName.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ packageNameParser =
9696
mkPackageName :: String -> Q Exp
9797
mkPackageName s =
9898
case parsePackageNameFromString s of
99-
Nothing -> stringError ("Invalid package name: " ++ show s)
99+
Nothing -> errorString ("Invalid package name: " ++ show s)
100100
Just pn -> [|pn|]
101101

102102
-- | Parse a package name from a 'Text'.

src/Stack/Types/TemplateName.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ parseTemplateNameFromString fname =
9595
mkTemplateName :: String -> Q Exp
9696
mkTemplateName s =
9797
case parseTemplateNameFromString s of
98-
Left{} -> stringError ("Invalid template name: " ++ show s)
98+
Left{} -> errorString ("Invalid template name: " ++ show s)
9999
Right (TemplateName (T.unpack -> prefix) p) ->
100100
[|TemplateName (T.pack prefix) $(pn)|]
101101
where pn =

0 commit comments

Comments
 (0)