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
format

One can find some background on this starting from:
http://msdn.microsoft.com/library/default.asp?url=
/library/en-us/automat/htm/chap11_55kj.asp

This guy has improved on the somewhat clumsy standard MS
implementation:
http://www.winwonk.com/writing/chainedei/

Paul