[ 
http://issues.apache.org/jira/browse/XERCESC-1401?page=comments#action_62370 ]
     
David Bertoni commented on XERCESC-1401:
----------------------------------------

The fact that your catch(...) handler catches an access violation is a property 
of Microsoft's asynchronous exception model.  On other platforms, your program 
would crash.  It should be clear from the documentation (or we should make it 
clear), that passing in a null pointer will lead to undefined behavior.

I'm not sure we should be checking for a null pointer and throwing an exception 
in this case, unless we plan to consistently do this for all of the DOM APIs.

> Not documented xerces-c exception: DOMNode::appendChild
> -------------------------------------------------------
>
>          Key: XERCESC-1401
>          URL: http://issues.apache.org/jira/browse/XERCESC-1401
>      Project: Xerces-C++
>         Type: Bug
>   Components: Documentation
>     Versions: 2.6.0
>  Environment: Win NT, MSVC 6.0
>     Reporter: Sergiy Michka

>
> I found that, DOMNode::appendChild throws unspecified xerces exception.
> The documented one 
> (http://xml.apache.org/xerces-c/apiDocs/classDOMNode.html#z113_15) is only 
> DOMException.
> My code looks like this:
> try
> {
> // ...
> DOMElement* child1 = pDoc->createElement(("child1"));
> rootElem->appendChild(child1);
> DOMText* child1_val = pDoc->createTextNode(("child1_val")));
> DOMText* child1_val2 = 0;
> child1_val2 = reinterpret_cast<DOMText*> (child1->appendChild(child1_val));
> // undocumented xerces exception
> }
> catch (DOMException& rExc)
> {
> throw MyException(rExc.getMessage());
> }
> catch (...) // not documented: what kind of Exception will be thrown?
> {
>  throw MyException(_T("Can not append TextNode"));
> }
> So whats wrong?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to