You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ne...@apache.org on 2004/01/06 05:42:53 UTC

cvs commit: xml-xerces/c/src/xercesc/validators/datatype DecimalDatatypeValidator.cpp

neilg       2004/01/05 20:42:53

  Modified:    c/src/xercesc/validators/datatype
                        DecimalDatatypeValidator.cpp
  Log:
  On some platforms, it is problematic to throw a different exception from inside the catch block of another exception
  
  Revision  Changes    Path
  1.23      +12 -4     xml-xerces/c/src/xercesc/validators/datatype/DecimalDatatypeValidator.cpp
  
  Index: DecimalDatatypeValidator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/datatype/DecimalDatatypeValidator.cpp,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- DecimalDatatypeValidator.cpp	3 Jan 2004 00:04:36 -0000	1.22
  +++ DecimalDatatypeValidator.cpp	6 Jan 2004 04:42:53 -0000	1.23
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.23  2004/01/06 04:42:53  neilg
  + * On some platforms, it is problematic to throw a different exception from inside the catch block of another exception
  + *
    * Revision 1.22  2004/01/03 00:04:36  peiyongz
    * using ctor/parseContent to avoid exception thrown from ctor
    *
  @@ -584,9 +587,9 @@
       // all other facet were inherited by the derived type
       if (asBase)
           return;
  -
  +    XMLCh *errorMsg = 0;
       try {
  -        XMLBigDecimal  compareDataValue(manager);
  +        XMLBigDecimal compareDataValue (manager);
           compareDataValue.parseContent(content);
           XMLBigDecimal* compareData = &compareDataValue;
           
  @@ -657,7 +660,12 @@
       }
       catch (XMLException &e)
       {
  -       ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::RethrowError, e.getMessage(), manager);
  +       errorMsg = XMLString::replicate(e.getMessage(), manager);
  +    }
  +    if(errorMsg)
  +    {
  +       ArrayJanitor<XMLCh> jan(errorMsg, manager);
  +       ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::RethrowError, errorMsg, manager);
       }
   }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org