Author: cargilld
Date: Sun Feb  5 18:19:17 2006
New Revision: 375157

URL: http://svn.apache.org/viewcvs?rev=375157&view=rev
Log:
Display actual errorCode when reporting an error.

Modified:
    xerces/c/branches/xerces-2.7/src/xercesc/internal/DGXMLScanner.cpp
    xerces/c/branches/xerces-2.7/src/xercesc/internal/IGXMLScanner.cpp
    xerces/c/branches/xerces-2.7/src/xercesc/internal/SGXMLScanner.cpp
    xerces/c/branches/xerces-2.7/src/xercesc/internal/XMLScanner.cpp
    xerces/c/branches/xerces-2.7/src/xercesc/internal/XMLScanner.hpp

Modified: xerces/c/branches/xerces-2.7/src/xercesc/internal/DGXMLScanner.cpp
URL: 
http://svn.apache.org/viewcvs/xerces/c/branches/xerces-2.7/src/xercesc/internal/DGXMLScanner.cpp?rev=375157&r1=375156&r2=375157&view=diff
==============================================================================
--- xerces/c/branches/xerces-2.7/src/xercesc/internal/DGXMLScanner.cpp 
(original)
+++ xerces/c/branches/xerces-2.7/src/xercesc/internal/DGXMLScanner.cpp Sun Feb  
5 18:19:17 2006
@@ -223,6 +223,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Warning
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -230,6 +231,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Fatal
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -237,6 +239,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Error
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -400,6 +403,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Warning
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -407,6 +411,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Fatal
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -414,6 +419,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Error
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -1677,12 +1683,14 @@
                 emitError
                 (
                     XMLErrs::DisplayErrorMessage
+                    , excToCatch.getCode()
                     , excToCatch.getMessage()
                 );
             else if (excToCatch.getErrorType() >= 
XMLErrorReporter::ErrType_Fatal)
                 emitError
                 (
                     XMLErrs::XMLException_Fatal
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -1690,6 +1698,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Error
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );

Modified: xerces/c/branches/xerces-2.7/src/xercesc/internal/IGXMLScanner.cpp
URL: 
http://svn.apache.org/viewcvs/xerces/c/branches/xerces-2.7/src/xercesc/internal/IGXMLScanner.cpp?rev=375157&r1=375156&r2=375157&view=diff
==============================================================================
--- xerces/c/branches/xerces-2.7/src/xercesc/internal/IGXMLScanner.cpp 
(original)
+++ xerces/c/branches/xerces-2.7/src/xercesc/internal/IGXMLScanner.cpp Sun Feb  
5 18:19:17 2006
@@ -260,6 +260,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Warning
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -267,6 +268,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Fatal
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -274,6 +276,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Error
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -443,6 +446,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Warning
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -450,6 +454,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Fatal
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -457,6 +462,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Error
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -2999,12 +3005,14 @@
                 emitError
                 (
                     XMLErrs::DisplayErrorMessage
+                    , excToCatch.getCode()
                     , excToCatch.getMessage()
                 );
             else if (excToCatch.getErrorType() >= 
XMLErrorReporter::ErrType_Fatal)
                 emitError
                 (
                     XMLErrs::XMLException_Fatal
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -3012,6 +3020,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Error
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );

Modified: xerces/c/branches/xerces-2.7/src/xercesc/internal/SGXMLScanner.cpp
URL: 
http://svn.apache.org/viewcvs/xerces/c/branches/xerces-2.7/src/xercesc/internal/SGXMLScanner.cpp?rev=375157&r1=375156&r2=375157&view=diff
==============================================================================
--- xerces/c/branches/xerces-2.7/src/xercesc/internal/SGXMLScanner.cpp 
(original)
+++ xerces/c/branches/xerces-2.7/src/xercesc/internal/SGXMLScanner.cpp Sun Feb  
5 18:19:17 2006
@@ -251,6 +251,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Warning
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -258,6 +259,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Fatal
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -265,6 +267,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Error
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -431,6 +434,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Warning
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -438,6 +442,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Fatal
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -445,6 +450,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Error
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -1925,12 +1931,14 @@
                 emitError
                 (
                     XMLErrs::DisplayErrorMessage
+                    , excToCatch.getCode()
                     , excToCatch.getMessage()
                 );
             else if (excToCatch.getErrorType() >= 
XMLErrorReporter::ErrType_Fatal)
                 emitError
                 (
                     XMLErrs::XMLException_Fatal
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );
@@ -1938,6 +1946,7 @@
                 emitError
                 (
                     XMLErrs::XMLException_Error
+                    , excToCatch.getCode()
                     , excToCatch.getType()
                     , excToCatch.getMessage()
                 );

Modified: xerces/c/branches/xerces-2.7/src/xercesc/internal/XMLScanner.cpp
URL: 
http://svn.apache.org/viewcvs/xerces/c/branches/xerces-2.7/src/xercesc/internal/XMLScanner.cpp?rev=375157&r1=375156&r2=375157&view=diff
==============================================================================
--- xerces/c/branches/xerces-2.7/src/xercesc/internal/XMLScanner.cpp (original)
+++ xerces/c/branches/xerces-2.7/src/xercesc/internal/XMLScanner.cpp Sun Feb  5 
18:19:17 2006
@@ -944,6 +944,53 @@
         throw toEmit;
 }
 
+void XMLScanner::emitError( const   XMLErrs::Codes      toEmit
+                            , const XMLExcepts::Codes   originalExceptCode
+                            , const XMLCh* const        text1
+                            , const XMLCh* const        text2
+                            , const XMLCh* const        text3
+                            , const XMLCh* const        text4)
+{
+    // Bump the error count if it is not a warning
+    if (XMLErrs::errorType(toEmit) != XMLErrorReporter::ErrType_Warning)
+        incrementErrorCount();
+
+    if (fErrorReporter)
+    {
+        //  Load the message into alocal and replace any tokens found in
+        //  the text.
+        const unsigned int maxChars = 2047;
+        XMLCh errText[maxChars + 1];
+
+        if (!gScannerMsgLoader().loadMsg(toEmit, errText, maxChars, text1, 
text2, text3, text4, fMemoryManager))
+        {
+                // <TBD> Should probably load a default message here
+        }
+
+        //  Create a LastExtEntityInfo structure and get the reader manager
+        //  to fill it in for us. This will give us the information about
+        //  the last reader on the stack that was an external entity of some
+        //  sort (i.e. it will ignore internal entities.
+        ReaderMgr::LastExtEntityInfo lastInfo;
+        fReaderMgr.getLastExtEntityInfo(lastInfo);
+
+        fErrorReporter->error
+        (
+            originalExceptCode
+            , XMLUni::fgExceptDomain    //fgXMLErrDomain
+            , XMLErrs::errorType(toEmit)
+            , errText
+            , lastInfo.systemId
+            , lastInfo.publicId
+            , lastInfo.lineNumber
+            , lastInfo.colNumber
+        );
+    }
+
+    // Bail out if its fatal an we are to give up on the first fatal error
+    if (emitErrorWillThrowException(toEmit))
+        throw toEmit;
+}
 
 // ---------------------------------------------------------------------------
 //  XMLScanner: Getter methods

Modified: xerces/c/branches/xerces-2.7/src/xercesc/internal/XMLScanner.hpp
URL: 
http://svn.apache.org/viewcvs/xerces/c/branches/xerces-2.7/src/xercesc/internal/XMLScanner.hpp?rev=375157&r1=375156&r2=375157&view=diff
==============================================================================
--- xerces/c/branches/xerces-2.7/src/xercesc/internal/XMLScanner.hpp (original)
+++ xerces/c/branches/xerces-2.7/src/xercesc/internal/XMLScanner.hpp Sun Feb  5 
18:19:17 2006
@@ -167,6 +167,15 @@
         , const char* const         text3 = 0
         , const char* const         text4 = 0
     );
+    void emitError
+    (
+        const   XMLErrs::Codes    toEmit
+        , const XMLExcepts::Codes   originalErrorCode
+        , const XMLCh* const        text1 = 0
+        , const XMLCh* const        text2 = 0
+        , const XMLCh* const        text3 = 0
+        , const XMLCh* const        text4 = 0
+    );
 
     // -----------------------------------------------------------------------
     //  Implementation of XMLBufferFullHandler interface



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

Reply via email to