[packagekit] PackageKit Backend Error Handling

Richard Hughes hughsient at gmail.com
Mon Jan 28 11:42:38 PST 2008


On Mon, 2008-01-28 at 17:00 +0000, Thomas Wood wrote:
> As these errors occur per-repository and there are often multiple
> repositories available, each error can occur multiple times in one
> transaction.

Ahh, multiple errors. I hadn't thought of that.

> Furthermore, signature failure is not to be considered fatal, rather it
> should be sent as a warning to the user.

Could you use a Message() rather than an Error() which is shown to the
user post-transaction? We already have the enum types:
PK_MESSAGE_ENUM_NOTICE, PK_MESSAGE_ENUM_WARNING and
PK_MESSAGE_ENUM_DAEMON - do any of those fit or do we need to create
another?

> So my question is, how can I translate these methods this to PackageKit?
> As far as I understand it, any error produced by a PackageKit backend is
> required to be fatal and therefore the backend can only ever report one
> error from a command.

Sure, an error has to be fatal, i.e. the daemon has to call Finished()
shortly after Error() and certainly not call Error() multiple times.

> Could someone point me in the right direction if there is something I've
> missed, or perhaps suggest some way we might solve this?

Would Message() do what you wish?

Richard.





More information about the PackageKit mailing list