[Kget] Error handling in KDE 4.5

Matthias Fuchs mat69 at gmx.net
Sat Feb 13 20:50:55 CET 2010


Am Samstag 13 Februar 2010 18:47:43 schrieb Lukas Appelhans:
> Hey!
> 
> I thought about this a bit  more...
> 
> For example there can also  be temporary error which will be worked around
> anyway... (for example one mirro rnot working)
> 
> I would propose to go this way about it:
> if the transfer does setError() and also setStatus(Job::Aborted); we will
> take the error as non-temporary and show the error-message all the time...
> 
> If it's just setError() then we take it as temporary...
That sounds very reasonable, though should we treat a fail of verification 
also as an error? Because in that case the download would not be aborted but 
rather finished and with a failed verification.
There is a backdraw I'll point out below.

> PS: I wonder if we need the Job::Error enum, as it doesn't really make a
> difference if kget-core knows *what* error it is...

Imo it would make sense as this way strings for commong errors only need to be 
defined once, e.g. Job::NotWriteAble.

Another thing we have to sort out is the way the errors are treated, take 
something like Job::WebResourceNotAvailable, it would be quite annoying to 
have many popups telling you that a server is not reachable atm. in that case 
it would be more useful to have that information in the details.

In other cases like with the checksums it would be good to be informed of the 
error as well with a way to fix it.

So what I think should happen is that any error is listed in the details, that 
would be some kind of log and that there are at least two methods, one 
setErrors(int errors, const QString &msg = QString(), bool report = false) and 
the other addError(int error, const QString &msg = QString(), bool report = 
false).

Take an example:
You have a metalink with one file A.zip and 4 mirrors.
The first mirror is not available addError(Job::WrongSize, i18n("At least one 
mirror reported the wrong size, so is not used for downloading."));
Another does not respond addError(Job::NotResponding, i18n("..."));
And then the whole fing results in a fail of verification 
addError(Job::FailedVerification, QString(), true); now only that error is 
shown to the user with a way to fix it, despite the fact that the download is 
finished.

We could also set these flags on the mirrors (should be really done with its 
own model) so that then the user would know which mirror reported the wrong 
size, which one is not available etc. That way we would avoid to set that 
information in the error message directly.

But that are just some thoughts I had right now, so that might be bollocks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 230 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kget/attachments/20100213/1c805570/attachment.sig 


More information about the Kget mailing list