KIO Error Handling update
Hamish Rodda
meddie at yoyo.its.monash.edu.au
Wed Apr 10 10:21:42 BST 2002
Hi all,
Here's my progress to date on extending the KIO error() mechanism. The goals
are:
1) Pre-defined error messages (KIO::ERR_*) should be more useful to the user
2) Slaves should be able to specify custom errors in greater detail
3) Binary compatability (of course)
All of my patches for this to date are here:
http://yoyo.cc.monash.edu.au/~meddie/patches/errors/
I've found that accomplishing goal 1 is difficult as we have to find a balance
for the right amount of information and how generic that information is. What
I'm proposing is that some of the KIO::ERR codes which are too generic are
deprecated in favour of slaves specifying the complete error message instead,
and the others are documented so that developers can better determine which
error code to use. This should get around the problem where the possible
causes and solutions list is too long and varied to be useful.
Goal 2 is accomplished by having the slaves send detailed error messages
through XML in the error text. This is made painless by a wrapper class,
KCustomError, which I've created. I've attached the header for those who
would be interested in reviewing it (the implementation is at the web address
above). The KCustomError header would likely also include many of the strings
which were added to global.cpp, so that they can be reused by slaves when
possible. Any new strings relevant to several slaves would then be placed
here instead.
What I'm after now is feedback on this proposal, mostly about KCustomError at
the moment; also, if it's ok to start committing to HEAD or not.
Thanks,
Hamish.
The patches at the location above do the following:
Patch 1: kio/kio
* add a new KIO::ERR_CUSTOM for errors specified in XML
* switch the dialog boxes to the detailed form
* add isNetworkProtocol() to KProtocolInfo, so error messages can determine if
the protocol uses a network or not (and thus whether to talk about servers &
networks or not)
Patch 2: khtml
* enable new error messages in khtml_part
Patch 3: http ioslave
* an example of KCustomError usage
* a few unrelated webdav fixes
Patch 4: kdebase/konqueror
* a bugfix to konq_run.cc so ampersands get through the error:/ system
Still on the to-do list:
* Make this change configurable (is this still wanted?)
* Work in a way for the system to determine what the current action was (get /
put / copy / move etc.)
* Produce HTML files of all of the error messages written to date for review.
* Add support for exec:/ URLs (any pointers for where to start - did
KActiveLabel get this functionality yet?)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kcustomerror.h
Type: text/x-chdr
Size: 2029 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20020410/19a52fb5/attachment.h>
More information about the kfm-devel
mailing list