You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Dor-Shifer Amit <Am...@comverse.com> on 2006/02/13 12:42:17 UTC
Exceptions from XMLPlatformUtils::initialize and in general
Hi,
Though in the API I can't seem to see that a/m method throws any
exceptions, I see that a lot of test programs in xerces-c's sourse tree
do wrap the call in try/catch. Why is that?
Apart from the exceptions mentioned in the API, should a using program
catch any other exceptions? What about OutOfMemoryException?
Amit
Re: Exceptions from XMLPlatformUtils::initialize and in general
Posted by David Bertoni <db...@apache.org>.
Dor-Shifer Amit wrote:
> Hi,
>
> Though in the API I can't seem to see that a/m method throws any
> exceptions, I see that a lot of test programs in xerces-c's sourse tree
> do wrap the call in try/catch. Why is that?
>
> Apart from the exceptions mentioned in the API, should a using program
> catch any other exceptions? What about OutOfMemoryException?
>
If you use the default MemoryManager implementation, you could get an
OutOfMemoryException. Also, I suspect there are places in the code
where initialization could throw exceptions, especially if you specify
the parameter that initializes all statics.
Note that you can install a PanicHandler if you want control over how
your application reacts to error conditions during initialization that
are so fundamental that exceptions can't be thrown. The default
PanicHandler behavior is to call exit().
Dave