File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
417417rawBuildInfo :: (StackM env m , HasEnvConfig env ) => m Value
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
6767data StackNixException
Original file line number Diff line number Diff 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))
101101cfgCmdSetValue (ConfigCmdSetSystemGhc _ bool) =
102102 return (Yaml. Bool bool)
Original file line number Diff line number Diff 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
334334getDefaultResolver
Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ updateIndexHackageSecurity
301301updateIndexHackageSecurity 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'
Original file line number Diff line number Diff 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" , " " ]
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ flagNameParser =
9494mkFlagName :: String -> Q Exp
9595mkFlagName 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'.
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ packageNameParser =
9696mkPackageName :: String -> Q Exp
9797mkPackageName 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'.
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ parseTemplateNameFromString fname =
9595mkTemplateName :: String -> Q Exp
9696mkTemplateName 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 =
You can’t perform that action at this time.
0 commit comments