[Libreoffice] [Libreoffice-qa] error checking in Base ODBC

Stephan Bergmann sbergman at redhat.com
Mon Oct 24 14:18:51 PDT 2011


On 10/24/2011 05:59 PM, Terrence Enger wrote:
> I shall proceed with that.  And, unless somebody tells me otherwise, I
> shall indulge myself with OSL_ENSURE() on the return values.

Note that OSL_ENSURE, OSL_ASSERT, and OSL_FAIL should only be used for 
logic errors (i.e., the program detects that it contains an error and 
ends up in a state that "cannot happen"), not for uncommon situations 
that nevertheless should be handled, like IO errors or malformed user 
input.  OSL_TRACE, on the other hand, is the tool of choice to document 
"interesting" events during program execution (which is only evaluated 
when built with DEBUG=TRUE, however).  --  Even if lots of places in the 
code base misuse the former for the latter.  Ideally, OSL_ENSURE et al. 
should directly abort program execution, but we're not there, yet.

Stephan


More information about the LibreOffice mailing list