Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Nicer failure message if LoadComponent contains rubbish.

  • Loading branch information...
commit 98f1c6da0481b9230619198e88cf165b4f4c97fa 1 parent fd9079b
@MarcWeber MarcWeber authored committed
Showing with 6 additions and 3 deletions.
  1. +6 −3 server/Scion/Server/Protocol/Vim.hs
View
9 server/Scion/Server/Protocol/Vim.hs
@@ -179,9 +179,12 @@ cmdOpenCabalProject = VimCommand "cmdOpenCabalProject" $ \map' -> do
cmdLoadComponent = VimCommand "cmdLoadComponent" $ \map' -> do
-- component is either "library" or "executable:name"
component <- requireArg map' "component"
- let comp = if component == "library"
- then Library
- else let (_,_:b) = break (== ':') component in Executable b
+ comp <- if component == "library"
+ then return Library
+ else case break (== ':') component of
+ (_,_:b) -> return $ Executable b
+ _ -> fail $ "couldn't parse component argument:\n"
+ ++ "either library or executable:executable_name expected"
liftM toVim $ loadComponent comp
cmdListSupportedLanguages = VimCommand "cmdListSupportedLanguages" $ \map' -> do
Please sign in to comment.
Something went wrong with that request. Please try again.