[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnu-arch-users] Error handling

From: Aaron Bentley
Subject: [Gnu-arch-users] Error handling
Date: 17 Dec 2003 14:01:55 -0500

On Fri, 2003-12-12 at 21:52, Aaron Bentley wrote:

> If patch-2 does not exist:
> address@hidden archeg]$ tla get engine--release7-6--3.0--patch-2
> corrupt archive
>   name: address@hidden
>   location: /mnt/extra/abentley/archives/development
>   revision: engine--release7-6--3.0--patch-2

This error was still bugging me, so I had a look at the code.
AFAICT, fs_revision_type is jumping to conclusions when it reports
"corrupt archive".  When the revision spec has been automatically
determined from the archive, inability to access the revision *does*
indicate a corrupt archive.

But in the "get" case, the revision spec is user-entered, and inability
to access the revision indicates "corrupt user", not corrupt archive.

Would you accept a patch that
1. causes fs_revision_type() to return 0 on success, -1 on failure, and
removes error message (and the same for pfs_revision_type).
2. moves the error message and exit(2) to arch_revision_type()
3. adds arch_revision_exists(), which takes the same parameters as
arch_revision_type, but returns 0 if the archive is accessible and -1 if
it is not
4. changes the arch_revision_type() call in build_revision() into
arch_revision_exists(), and reports "no such revision" if it returns -1


Aaron Bentley
Director of Technology
PanoMetrics, Inc.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]