[packagekit] Reviewing use of internal-error

Elliot Peele elliot at bentlogic.net
Mon Mar 24 17:32:06 PDT 2008


On Mon, Mar 24, 2008 at 09:48:30PM +0000, Richard Hughes wrote:
> On Mon, 2008-03-24 at 16:21 -0400, Elliot Peele wrote:
> > I don't really get a better error from conary unless I try to parse
> > the text of the exception. I intend to return the enum and the text of
> > the exception to the user.
> 
> Ick. The whole point of the error enum is so we can show the user a
> useful translated string, something like "The update cannot be updated
> because the mainframe is too old" rather than "The update cannot be
> completed". The former explains _why_ to the user in an understandable
> way and we can also add an extended localised description to a
> suggestion such as "Please restart the mainframe"
> 
> I think parsing the error text might be the best plan, unless you can
> extend the conary API to be more descriptive with errors.

I could probably write a translation layer that converts update error
into a few different things. Just as a first pass I greped through the
conary client code to see where it raises update error.

Update Errors:

* 'Write permission denied on conary database'
* 'Redirect found with --no-recurse set %s=%s[%s]'
* 'Redirect loop found which includes troves %s, %s'
* 'Failed to find required troves for update:\n   %s'
* 'Update of %s specifies multiple troves for removal'
* 'Relative update of %s specifies multiple troves for install'
* 'Cannot migrate to redirect(s), as they are all erases - \n%s'
* 'Redirect Loop detected - trove %s=%s[%s] redirects to itself'
* 'Redirect Loop detected - includes %s=%s[%s] and %s=%s[%s]'
* 'Cannot perform relative updates or erases as part of full migration'
* 'keepExisting specified for a relative change set'
* 'changeset cannot be applied:\n%s'
* 'error: preupdate script failed'
* 'error: download thread terminated unexpectedly, cannot continue update'

There are a few others that are a bit longer, but they are sub classes
of update error that can be handled separately.

* DowngradeError
* UpdatePinnedTroveError
* DependencyFailure
* DepResolutionFailure
* EraseDepFailure
* NeededTrovesFailure
* InstallPathConflicts

I'm going to file a feature request against conary to add unique
exceptions for the generic update errors listed above, but this is what
I have to work with right now.

Elliot

-- 
Elliot Peele
elliot at bentlogic.net



More information about the PackageKit mailing list