factored out some useful error catching methods

This commit is contained in:
Joey Hess 2011-11-10 20:24:24 -04:00
parent a71c03bc51
commit 49d2177d51
15 changed files with 54 additions and 61 deletions

View file

@ -173,7 +173,7 @@ gpgParams :: [CommandParam] -> IO [String]
gpgParams params = do
-- Enable batch mode if GPG_AGENT_INFO is set, to avoid extraneous
-- gpg output about password prompts.
e <- catch (getEnv "GPG_AGENT_INFO") (const $ return "")
e <- catchDefaultIO (getEnv "GPG_AGENT_INFO") ""
let batch = if null e then [] else ["--batch"]
return $ batch ++ defaults ++ toCommand params
where