Exceptions in KDE Frameworks

Mirko Boehm mirko at kde.org
Fri Nov 1 16:30:02 UTC 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, 

in ThreadWeaver, I would like to be able to catch exceptions thrown from the run() method of Jobs. You know we cannot trust the user :-) I can work around if exceptions are disabled in the compiler if I know about it. What I would like to be able to do is 

a) catch JobAborted and JobFailed exceptions thrown by the user, and set the job's status accordingly, 
b) catch other unhandled exceptions, print an error message and re-throw them. Unhandled exceptions in the worker thread basically mean the end of the program, as far as I am concerned, but I would like to be able to exit cleanly. 

Two questions: 

1) Are we sure we want to disable exceptions in libraries released in 2014?
2) What is the _BLBAFASEL_EXCEPTIONS_ENABLED_ preprocessor variable that I can use to implemented the exception- and non-exception based code paths?

Thanks,

Mirko.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlJz1woACgkQYSSaITCTnKVaoQCeI9L48n2Cn8TA5X9nC1tLctzV
XagAoIyUwA9sBOhFbkSWupsCA2P2YJHt
=hAER
-----END PGP SIGNATURE-----


More information about the Kde-frameworks-devel mailing list