diff options
author | 2015-11-18 12:30:01 -0400 | |
---|---|---|
committer | 2015-11-18 12:30:01 -0400 | |
commit | 1ced111396e46137e9f0d85e2c22ee79c71e93b5 (patch) | |
tree | 2bca51552849cfa6cb6797f90506cca9cf03d829 | |
parent | 7e32cc5cdef6f74b5b2993e148398353633b0c3f (diff) |
improve error message when special remote program cannot be run
-rw-r--r-- | Remote/External.hs | 15 | ||||
-rw-r--r-- | doc/special_remotes/ipfs/comment_6_8621bbd87982f73cf401cfa09d95d1e4._comment | 10 |
2 files changed, 19 insertions, 6 deletions
diff --git a/Remote/External.hs b/Remote/External.hs index 897a6a72b..45720d4a1 100644 --- a/Remote/External.hs +++ b/Remote/External.hs @@ -369,12 +369,8 @@ startExternal :: ExternalType -> Annex ExternalState startExternal externaltype = do errrelayer <- mkStderrRelayer liftIO $ do - (Just hin, Just hout, Just herr, pid) <- createProcess $ - (proc cmd []) - { std_in = CreatePipe - , std_out = CreatePipe - , std_err = CreatePipe - } + (Just hin, Just hout, Just herr, pid) <- + createProcess p `catchIO` runerr fileEncoding hin fileEncoding hout fileEncoding herr @@ -390,6 +386,13 @@ startExternal externaltype = do } where cmd = externalRemoteProgram externaltype + p = (proc cmd []) + { std_in = CreatePipe + , std_out = CreatePipe + , std_err = CreatePipe + } + + runerr _ = error ("Cannot run " ++ cmd ++ " -- Make sure it's in your PATH and is executable.") checkearlytermination Nothing = noop checkearlytermination (Just exitcode) = ifM (inPath cmd) diff --git a/doc/special_remotes/ipfs/comment_6_8621bbd87982f73cf401cfa09d95d1e4._comment b/doc/special_remotes/ipfs/comment_6_8621bbd87982f73cf401cfa09d95d1e4._comment new file mode 100644 index 000000000..4d547ea3b --- /dev/null +++ b/doc/special_remotes/ipfs/comment_6_8621bbd87982f73cf401cfa09d95d1e4._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 6""" + date="2015-11-18T16:22:51Z" + content=""" +@rob.syme I think that error message is pretty clear: git-annex-remote-ipfs +is not present in your PATH or perhaps is not executable. + +(Still, the error message could be improved a bit, doing that now.) +"""]] |