summaryrefslogtreecommitdiff
path: root/Annex/Transfer.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/Transfer.hs')
-rw-r--r--Annex/Transfer.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/Annex/Transfer.hs b/Annex/Transfer.hs
index dac32e752..0d5744d4e 100644
--- a/Annex/Transfer.hs
+++ b/Annex/Transfer.hs
@@ -150,7 +150,9 @@ notifyTransfer direction (Just f) a = do
let action = if direction == Upload then "uploading" else "downloading"
let basedesc = action ++ " " ++ f
let startdesc = "started " ++ basedesc
- let enddesc = "finished " ++ basedesc
+ let enddesc ok = if ok
+ then "finished " ++ basedesc
+ else basedesc ++ " failed"
if (notifyStart wanted || notifyFinish wanted)
then do
client <- liftIO DBus.Client.connectSession
@@ -166,12 +168,12 @@ notifyTransfer direction (Just f) a = do
startnotification <- liftIO $ if notifyStart wanted
then Just <$> Notify.notify client (mknote startdesc)
else pure Nothing
- r <- a NotifyWitness
+ ok <- a NotifyWitness
when (notifyFinish wanted) $ liftIO $ void $ maybe
- (Notify.notify client $ mknote enddesc)
- (\n -> Notify.replace client n $ mknote enddesc)
+ (Notify.notify client $ mknote $ enddesc ok)
+ (\n -> Notify.replace client n $ mknote $ enddesc ok)
startnotification
- return r
+ return ok
else a NotifyWitness
#else
a NotifyWitness