[Kde-pim] MessageQueueJob sends email but returns error

Oleg Girko ol+kde at infoserver.ru
Mon Mar 12 15:41:41 GMT 2012


On Monday March 12 2012 09:50:20 David Jarvie wrote:

> At first sight it would be more manageable to define the error codes in
> each Job class. The snag with this is that one job class may want to
> return an error code returned by another job class (e.g. StoreResultJob
> calls ItemFetchJob and if that returns an error, StoreResultJob may want
> to return the ItemFetchJob error instead of its own error code). That
> would require each job class to use its own range of error codes,
> non-overlapping with other job classes.
> 
> Having said that, we may want to be able to return combinations of error
> codes - e.g. StoreResultJob may want to return its own error code, with
> the ItemFetchJob error code as an additional piece of information. This
> would correspond with the way that errorString() works, where each time
> the error string is set, it adds the new error string to whatever is
> already set. This would require more than the simple error() method which
> already exists.

Why you guys don't just use something like system_error facility from C++11 
standard library (or boost::system, which is essentially equivalent)?

The system_error facility allows overlapping error code for different error 
categories, returning and copying error codes without risk of slicing, 
defining custom error codes specific for a library or application, defining 
custom error conditions to compare error codes to.

There are good blog posts explaining system_error in details here:
http://blog.think-async.com/search/label/error_code

Best regards,
-- Oleg Girko, http://www.infoserver.ru/~ol/
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list