Subject Re: Error Reporting in New API
Author paulruizendaal
I was wondering if we could learn from error handling in COM,
including variants like XPCOM and UNO. COM components have to deal
with multi-threading and multiple exception handling models.

It seems to me that the COM model combines the suggestions of Nicolay,
Jim and Dmitry, building on the merits of each one.

(i) in first instance, errors are reported in a scalar return value
(a HRESULT, could be GDSCODE for us);
(ii) following an error, the application calls a GetError type
function, which returns a thread-specific value;
(iii) the thread-specific value is a pointer to an error object in COM

One can find some background on this starting from:

This guy has improved on the somewhat clumsy standard MS