fix handling of ERROR in response to CHECKPRESENT

That error is now rethrown on the client, so it will be displayed.

For example:

$ git-annex fsck x --fast --from AMS-dir
fsck x (special remote reports: directory /home/joey/tmp/bench2/dir is not accessible) failed

No protocol version check is needed. Because in order to talk to a
proxied special remote, the client has to be running the upcoming
git-annex release. Which has this fix in it.
This commit is contained in:
Joey Hess 2024-06-28 13:42:25 -04:00
parent d3c75c003a
commit a6ea057f6b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 23 additions and 10 deletions

View file

@ -81,7 +81,7 @@ proxySpecialRemote protoversion r ihdl ohdl endv = go
tryNonAsync (Remote.checkPresent r k) >>= \case
Right True -> sendmessage SUCCESS
Right False -> sendmessage FAILURE
Left err -> sendmessage (ERROR (show err))
Left err -> propagateerror err
go
Just (LOCKCONTENT _) -> do
-- Special remotes do not support locking content.
@ -119,3 +119,6 @@ proxySpecialRemote protoversion r ihdl ohdl endv = go
sendmessage m = liftIO $ atomically $ putTMVar ihdl (Right m)
sendbytestring b = liftIO $ atomically $ putTMVar ihdl (Left b)
propagateerror err = sendmessage $ ERROR $
"proxied special remote reports: " ++ show err