[darcs-devel] [patch1791] fix several uses of error where it shoul... (and 7 more)

Ganesh Sittampalam bugs at darcs.net
Sun Jun 2 20:53:38 UTC 2019


Ganesh Sittampalam <ganesh at earth.li> added the comment:

>  * fix several uses of error where it should be fail
  
>  These situations are normal failure conditions and not bugs in Darcs.


> hunk ./src/Darcs/Repository/PatchIndex.hs 730
> -      unless (isInOrder ascTs pids) (error $ "In order test failed! 
filename: " ++ show fn)
> -      forM_ spans $ \(FidSpan fid _ _) -> unless (M.member fid fpspans) 
(error $ "Valid file id test failed! fid: " ++ show fid)
> +      unless (isInOrder ascTs pids) (fail $ "In order test failed! 
filename: " ++ show fn)
> +      forM_ spans $ \(FidSpan fid _ _) -> unless (M.member fid fpspans) 
(fail $ "Valid file id test failed! fid: " ++ show fid)
hunk ./src/Darcs/Repository/PatchIndex.hs 742
> -      unless (isInOrder ascTs pids) (error $ "In order test failed! 
fileid: " ++ show fid)
> -      forM_ spans $ \(FpSpan fn _ _) -> unless (M.member fn fidspans) 
(error $ "Valid file name test failed! file name: " ++ show fn)
> +      unless (isInOrder ascTs pids) (fail $ "In order test failed! 
fileid: " ++ show fid)
> +      forM_ spans $ \(FpSpan fn _ _) -> unless (M.member fn fidspans) 
(fail $ "Valid file name test failed! file name: " ++ show fn)
> hunk ./src/Darcs/Repository/PatchIndex.hs 747
> -      unless (and $ zipWith f spans (tail spans)) (error $ "Adjcency > 
test failed! fid: " ++ show fid)
> +      unless (and $ zipWith f spans (tail spans)) (fail $ "Adjcency 
test failed! fid: " ++ show fid)

How is the user supposed to understand/recover from these errors? Do
they indicate that the patch index is corrupt and should be recreated,
for example?

----------
status: needs-review -> review-in-progress

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1791>
__________________________________


More information about the darcs-devel mailing list