Update: attached patched also catch ValueError exceptions, which can happen as well.
Also attaching similar patch for pgarchives.
As being confused by the lack of error message happened to me again, I think these patches are useful.
--
Célestin Matte